1 8 package org.apache.avalon.excalibur.datasource; 9 10 import java.sql.CallableStatement ; 11 import java.sql.Connection ; 12 import java.sql.DatabaseMetaData ; 13 import java.sql.PreparedStatement ; 14 import java.sql.SQLException ; 15 import java.sql.SQLWarning ; 16 import java.sql.Statement ; 17 import java.sql.Savepoint ; 18 import java.util.Map ; 19 20 32 public class Jdbc3Connection 33 extends AbstractJdbcConnection 34 { 35 public Jdbc3Connection( final Connection connection, final String keepAlive ) 36 { 37 super( connection, keepAlive ); 38 } 39 40 public final Statement createStatement() 41 throws SQLException 42 { 43 final Statement temp = m_connection.createStatement(); 44 m_lastUsed = System.currentTimeMillis(); 45 return temp; 46 } 47 48 public final PreparedStatement prepareStatement( final String sql ) 49 throws SQLException 50 { 51 final PreparedStatement temp = m_connection.prepareStatement( sql ); 52 m_lastUsed = System.currentTimeMillis(); 53 return temp; 54 } 55 56 public final CallableStatement prepareCall( final String sql ) 57 throws SQLException 58 { 59 final CallableStatement temp = m_connection.prepareCall( sql ); 60 m_lastUsed = System.currentTimeMillis(); 61 return temp; 62 } 63 64 public final String nativeSQL( final String sql ) 65 throws SQLException 66 { 67 return m_connection.nativeSQL( sql ); 68 } 69 70 public final void setAutoCommit( final boolean autoCommit ) 71 throws SQLException 72 { 73 m_connection.setAutoCommit( autoCommit ); 74 } 75 76 public final boolean getAutoCommit() 77 throws SQLException 78 { 79 return m_connection.getAutoCommit(); 80 } 81 82 public final void commit() 83 throws SQLException 84 { 85 m_connection.commit(); 86 m_lastUsed = System.currentTimeMillis(); 87 } 88 89 public final void rollback() 90 throws SQLException 91 { 92 m_connection.rollback(); 93 m_lastUsed = System.currentTimeMillis(); 94 } 95 96 public final DatabaseMetaData getMetaData() 97 throws SQLException 98 { 99 return m_connection.getMetaData(); 100 } 101 102 public final void setReadOnly( final boolean readOnly ) 103 throws SQLException 104 { 105 m_connection.setReadOnly( readOnly ); 106 } 107 108 public final boolean isReadOnly() 109 throws SQLException 110 { 111 return m_connection.isReadOnly(); 112 } 113 114 public final void setCatalog( final String catalog ) 115 throws SQLException 116 { 117 m_connection.setCatalog( catalog ); 118 } 119 120 public final String getCatalog() 121 throws SQLException 122 { 123 return m_connection.getCatalog(); 124 } 125 126 public final void setTransactionIsolation( final int level ) 127 throws SQLException 128 { 129 m_connection.setTransactionIsolation(level); 130 } 131 132 public final int getTransactionIsolation() 133 throws SQLException 134 { 135 return m_connection.getTransactionIsolation(); 136 } 137 138 public final SQLWarning getWarnings() 139 throws SQLException 140 { 141 return m_connection.getWarnings(); 142 } 143 144 public final void clearWarnings() 145 throws SQLException 146 { 147 m_connection.clearWarnings(); 148 } 149 150 public final Statement createStatement( final int resultSetType, 151 final int resultSetConcurrency ) 152 throws SQLException 153 { 154 final Statement temp = m_connection.createStatement( 155 resultSetType, resultSetConcurrency 156 ); 157 158 m_lastUsed = System.currentTimeMillis(); 159 return temp; 160 } 161 162 public final PreparedStatement prepareStatement( final String sql, 163 final int resultSetType, 164 final int resultSetConcurrency ) 165 throws SQLException 166 { 167 final PreparedStatement temp = m_connection.prepareStatement( 168 sql, resultSetType, resultSetConcurrency 169 ); 170 171 m_lastUsed = System.currentTimeMillis(); 172 return temp; 173 } 174 175 public final CallableStatement prepareCall( final String sql, 176 final int resultSetType, 177 final int resultSetConcurrency ) 178 throws SQLException 179 { 180 final CallableStatement temp = m_connection.prepareCall( 181 sql, resultSetType, resultSetConcurrency 182 ); 183 184 m_lastUsed = System.currentTimeMillis(); 185 return temp; 186 } 187 188 public final Map getTypeMap() 189 throws SQLException 190 { 191 return m_connection.getTypeMap(); 192 } 193 194 public final void setTypeMap( final Map map ) 195 throws SQLException 196 { 197 m_connection.setTypeMap( map ); 198 } 199 200 public final void setHoldability(int holdability) 201 throws SQLException 202 { 203 m_connection.setHoldability(holdability); 204 } 205 206 public final int getHoldability() 207 throws SQLException 208 { 209 return m_connection.getHoldability(); 210 } 211 212 public final Savepoint setSavepoint() 213 throws SQLException 214 { 215 return m_connection.setSavepoint(); 216 } 217 218 public final Savepoint setSavepoint(String savepoint) 219 throws SQLException 220 { 221 return m_connection.setSavepoint(savepoint); 222 } 223 224 public final void rollback(Savepoint savepoint) 225 throws SQLException 226 { 227 m_connection.rollback(savepoint); 228 m_lastUsed = System.currentTimeMillis(); 229 } 230 231 public final void releaseSavepoint(Savepoint savepoint) 232 throws SQLException 233 { 234 m_connection.releaseSavepoint(savepoint); 235 } 236 237 public final Statement createStatement(int resulSetType, 238 int resultSetConcurrency, 239 int resultSetHoldability) 240 throws SQLException 241 { 242 final Statement temp = m_connection.createStatement( 243 resultSetType, resultSetConcurrency, resultSetHoldability 244 ); 245 246 m_lastUsed = System.currentTimeMillis(); 247 return temp; 248 } 249 250 public final PreparedStatement prepareStatement(String sql, 251 int resulSetType, 252 int resultSetConcurrency, 253 int resultSetHoldability) 254 throws SQLException 255 { 256 final PreparedStatement temp = m_connection.prepareStatement( 257 sql, resultSetType, resultSetConcurrency, resultSetHoldability 258 ); 259 260 m_lastUsed = System.currentTimeMillis(); 261 return temp; 262 } 263 264 public final CallableStatement prepareCall(String sql, 265 int resulSetType, 266 int resultSetConcurrency, 267 int resultSetHoldability) 268 throws SQLException 269 { 270 final CallableStatement temp = m_connection.prepareCall( 271 sql, resultSetType, resultSetConcurrency, resultSetHoldability 272 ); 273 274 m_lastUsed = System.currentTimeMillis(); 275 return temp; 276 } 277 278 public final PreparedStatement prepareStatement(String sql, 279 int autoGeneratedKeys) 280 throws SQLException 281 { 282 final PreparedStatement temp = m_connection.prepareStatement( 283 sql, autoGeneratedKeys 284 ); 285 286 m_lastUsed = System.currentTimeMillis(); 287 return temp; 288 } 289 290 public final PreparedStatement prepareStatement(String sql, 291 int[] columnIndexes) 292 throws SQLException 293 { 294 final PreparedStatement temp = m_connection.prepareStatement( 295 sql, columnIndexes 296 ); 297 298 m_lastUsed = System.currentTimeMillis(); 299 return temp; 300 } 301 302 public final PreparedStatement prepareStatement(String sql, 303 String [] columnNames) 304 throws SQLException 305 { 306 final PreparedStatement temp = m_connection.prepareStatement( 307 sql, columnNames 308 ); 309 310 m_lastUsed = System.currentTimeMillis(); 311 return temp; 312 } 313 } 314 | Popular Tags |