1 22 package org.enhydra.jdbc.standard; 23 24 import java.sql.SQLException ; 25 import java.sql.Statement ; 26 import org.enhydra.jdbc.core.CoreStatement; 27 28 public class StandardXAStatement extends CoreStatement { 29 30 private StandardXAConnectionHandle con; 31 private boolean closed; private int resultSetType; 34 private int resultSetConcurrency; 35 private int resultSetHoldability; 36 37 40 StandardXAStatement( 41 StandardXAConnectionHandle con, 42 int resultSetType, 43 int resultSetConcurrency, 44 int resultSetHoldability) 45 throws SQLException { 46 this.con = con; 47 this.resultSetType = resultSetType; 48 this.resultSetConcurrency = resultSetConcurrency; 49 this.resultSetHoldability = resultSetHoldability; 50 log = con.log; 51 statement = newStatement(); 52 } 53 54 private Statement newStatement() throws SQLException { 55 if (resultSetType == 0 && resultSetConcurrency == 0 && resultSetHoldability == 0) { 56 return con.con.createStatement(); 57 } else if (resultSetHoldability == 0) { 58 return con.con.createStatement(resultSetType, resultSetConcurrency); 59 } else return con.con.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); 60 } 61 62 65 public synchronized void close() throws SQLException { 66 super.close(); closed = true; 68 } 69 70 71 74 public void catchInvoke(SQLException sqlException) throws SQLException { 75 throw (sqlException); 78 } 79 80 } 81 | Popular Tags |