1 21 22 package org.apache.derby.iapi.jdbc; 23 24 import java.sql.Statement ; 25 import java.sql.PreparedStatement ; 26 import java.sql.CallableStatement ; 27 import java.sql.SQLException ; 28 import java.sql.Savepoint ; 29 import org.apache.derby.iapi.reference.JDBC30Translation; 30 31 34 public class BrokeredConnection30 extends BrokeredConnection 35 { 36 37 public BrokeredConnection30(BrokeredConnectionControl control) 38 { 39 super(control); 40 } 41 42 public final Statement createStatement(int resultSetType, 43 int resultSetConcurrency, 44 int resultSetHoldability) 45 throws SQLException { 46 try { 47 resultSetHoldability = statementHoldabilityCheck(resultSetHoldability); 48 return control.wrapStatement(getRealConnection().createStatement(resultSetType, 49 resultSetConcurrency, resultSetHoldability)); 50 } 51 catch (SQLException se) 52 { 53 notifyException(se); 54 throw se; 55 } 56 } 57 public final CallableStatement prepareCall(String sql, 58 int resultSetType, 59 int resultSetConcurrency, 60 int resultSetHoldability) 61 throws SQLException { 62 try { 63 resultSetHoldability = statementHoldabilityCheck(resultSetHoldability); 64 return control.wrapStatement( 65 getRealConnection().prepareCall(sql, resultSetType, 66 resultSetConcurrency, resultSetHoldability), sql); 67 } 68 catch (SQLException se) 69 { 70 notifyException(se); 71 throw se; 72 } 73 } 74 75 public final Savepoint setSavepoint() 76 throws SQLException 77 { 78 try { 79 control.checkSavepoint(); 80 return getRealConnection().setSavepoint(); 81 } 82 catch (SQLException se) 83 { 84 notifyException(se); 85 throw se; 86 } 87 } 88 89 public final Savepoint setSavepoint(String name) 90 throws SQLException 91 { 92 try { 93 control.checkSavepoint(); 94 return getRealConnection().setSavepoint(name); 95 } 96 catch (SQLException se) 97 { 98 notifyException(se); 99 throw se; 100 } 101 } 102 103 public final void rollback(Savepoint savepoint) 104 throws SQLException 105 { 106 try { 107 control.checkRollback(); 108 getRealConnection().rollback(savepoint); 109 } 110 catch (SQLException se) 111 { 112 notifyException(se); 113 throw se; 114 } 115 } 116 117 public final void releaseSavepoint(Savepoint savepoint) 118 throws SQLException 119 { 120 try { 121 getRealConnection().releaseSavepoint(savepoint); 122 } 123 catch (SQLException se) 124 { 125 notifyException(se); 126 throw se; 127 } 128 } 129 130 131 public final void setHoldability(int holdability) 132 throws SQLException 133 { 134 try { 135 holdability = control.checkHoldCursors(holdability, false); 136 getRealConnection().setHoldability(holdability); 137 stateHoldability = holdability; 138 } 139 catch (SQLException se) 140 { 141 notifyException(se); 142 throw se; 143 } 144 } 145 146 public final PreparedStatement prepareStatement( 147 String sql, 148 int autoGeneratedKeys) 149 throws SQLException 150 { 151 try { 152 return control.wrapStatement(getRealConnection().prepareStatement(sql, autoGeneratedKeys), sql, new Integer (autoGeneratedKeys)); 153 } 154 catch (SQLException se) 155 { 156 notifyException(se); 157 throw se; 158 } 159 } 160 161 public final PreparedStatement prepareStatement( 162 String sql, 163 int[] columnIndexes) 164 throws SQLException 165 { 166 try { 167 return control.wrapStatement(getRealConnection().prepareStatement(sql, columnIndexes), sql, columnIndexes); 168 } 169 catch (SQLException se) 170 { 171 notifyException(se); 172 throw se; 173 } 174 } 175 176 public final PreparedStatement prepareStatement( 177 String sql, 178 String [] columnNames) 179 throws SQLException 180 { 181 try { 182 return control.wrapStatement(getRealConnection().prepareStatement(sql, columnNames), sql, columnNames); 183 } 184 catch (SQLException se) 185 { 186 notifyException(se); 187 throw se; 188 } 189 } 190 191 public BrokeredPreparedStatement newBrokeredStatement(BrokeredStatementControl statementControl, String sql, Object generatedKeys) throws SQLException { 192 return new BrokeredPreparedStatement30(statementControl, getJDBCLevel(), sql, generatedKeys); 193 } 194 public BrokeredCallableStatement newBrokeredStatement(BrokeredStatementControl statementControl, String sql) throws SQLException { 195 return new BrokeredCallableStatement30(statementControl, getJDBCLevel(), sql); 196 } 197 198 int getJDBCLevel() { return 3;} 199 200 } 201 | Popular Tags |