1 22 package org.enhydra.jdbc.standard; 23 24 import java.sql.PreparedStatement ; 25 import java.sql.SQLException ; 26 import org.enhydra.jdbc.core.CorePreparedStatement; 27 28 36 public class StandardPreparedStatement extends CorePreparedStatement { 37 38 public Object key; 39 private StandardConnectionHandle con; 41 public boolean closed; 44 47 StandardPreparedStatement( 48 StandardConnectionHandle con, 49 PreparedStatement preparedStatement, 50 Object key) { 51 this.con = con; 52 this.key = key; 53 ps = preparedStatement; 54 } 55 56 StandardPreparedStatement() { 57 super(); 58 } 59 60 63 public void close() throws SQLException { 64 closed = true; 66 if (con.preparedStmtCacheSize == 0) { 67 if (ps != null) { 69 ps.close(); 70 } 71 } else { 72 con.returnToCache(key); 73 } 75 } 76 77 81 public void preInvoke() throws SQLException { 82 if (closed) 83 throw new SQLException ("Prepare Statement is closed"); 84 } 85 86 89 public void catchInvoke(SQLException sqlException) throws SQLException { 90 throw (sqlException); 93 } 94 95 } 96 | Popular Tags |