1 21 22 package org.apache.derby.iapi.db; 23 24 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 25 import org.apache.derby.iapi.sql.conn.ConnectionUtil; 26 27 37 public class OptimizerTrace 38 { 39 46 public static boolean setOptimizerTrace(boolean onOrOff) 47 { 48 boolean retCode = false; 49 50 try 51 { 52 LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); 55 retCode = lcc.setOptimizerTrace(onOrOff); 56 } 57 catch (Throwable t) 58 { 59 } 61 62 return retCode; 63 } 64 65 72 public static boolean setOptimizerTraceHtml(boolean onOrOff) 73 { 74 boolean retCode = false; 75 76 try 77 { 78 LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); 81 retCode = lcc.setOptimizerTraceHtml(onOrOff); 82 } 83 catch (Throwable t) 84 { 85 } 87 88 return retCode; 89 } 90 91 99 public static String getOptimizerTraceOutput() 100 { 101 String retCode = null; 102 103 try 104 { 105 LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); 108 retCode = lcc.getOptimizerTraceOutput(); 109 } 110 catch (Throwable t) 111 { 112 } 114 115 return retCode; 116 } 117 118 128 public static boolean writeOptimizerTraceOutputHtml(String fileName) 129 { 130 boolean retCode = true; 131 132 try 133 { 134 String output = getOptimizerTraceOutput(); 135 } 137 catch (Throwable t) 138 { 139 retCode = false; 141 } 142 143 return retCode; 144 } 145 146 } 147 | Popular Tags |