1 package org.apache.ojb.broker.platforms; 2 3 17 18 import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor; 19 import org.apache.ojb.broker.query.LikeCriteria; 20 21 import java.sql.CallableStatement ; 22 import java.sql.Connection ; 23 import java.sql.PreparedStatement ; 24 import java.sql.ResultSet ; 25 import java.sql.SQLException ; 26 import java.sql.Statement ; 27 import java.util.Properties ; 28 29 38 public interface Platform 39 { 40 41 44 void afterStatementCreate(Statement stmt) throws PlatformException; 45 46 50 void beforeStatementClose(Statement stmt, ResultSet rs) throws PlatformException; 51 52 56 void afterStatementClose(Statement stmt, ResultSet rs) throws PlatformException; 57 58 63 void beforeBatch(PreparedStatement stmt) throws PlatformException; 64 65 70 void addBatch(PreparedStatement stmt) throws PlatformException; 71 72 77 int[] executeBatch(PreparedStatement stmt) throws PlatformException; 78 79 84 void initializeJdbcConnection(JdbcConnectionDescriptor jcd, Connection conn) throws PlatformException; 85 86 95 void changeAutoCommitState(JdbcConnectionDescriptor jcd, Connection con, boolean newState); 96 97 101 void setObjectForStatement(PreparedStatement ps, int index, Object value, int sqlType) 102 throws SQLException ; 103 104 108 void setNullForStatement(PreparedStatement ps, int index, int sqlType) 109 throws SQLException ; 110 111 118 byte getJoinSyntaxType(); 119 120 124 boolean useCountForResultsetSize(); 125 126 132 boolean supportsBatchOperations(); 133 134 143 150 String createSequenceQuery(String sequenceName, Properties prop); 151 152 159 String createSequenceQuery(String sequenceName); 160 161 165 String nextSequenceQuery(String sequenceName); 166 167 171 String dropSequenceQuery(String sequenceName); 172 173 188 CallableStatement prepareNextValProcedureStatement(Connection con, String procedureName, 189 String sequenceName) throws PlatformException; 190 191 195 String getLastInsertIdentityQuery(String tableName); 196 197 201 boolean supportsPaging(); 202 203 207 void addPagingSql(StringBuffer anSqlString); 208 209 213 boolean bindPagingParametersFirst(); 214 215 223 int bindPagingParameters(PreparedStatement ps, int index, int startAt, int endAt) throws SQLException ; 224 225 230 boolean supportsMultiColumnCountDistinct(); 231 232 241 String concatenate(String [] theColumns); 242 243 247 String getEscapeClause(LikeCriteria aCriteria); 248 249 258 265 void registerOutResultSet(CallableStatement stmt, int position) 266 throws SQLException ; 267 268 } 269 | Popular Tags |