1 22 23 28 29 package org.xquark.mapper.dbms; 30 31 import java.sql.*; 32 import java.util.Collection ; 33 import java.util.List ; 34 import java.util.Map ; 35 36 import org.xquark.jdbc.typing.DbType; 37 import org.xquark.jdbc.typing.TypeMap; 38 import org.xquark.mapper.RepositoryException; 39 import org.xquark.mapper.metadata.Repository; 40 41 47 public interface AbstractConnection 48 { 49 50 54 public Connection getConnection(); 55 56 59 public short getDBMSType(); 60 61 64 public String getSchemaName(); 65 66 67 public void close() throws SQLException; 68 69 70 public TypeMap getTypeMap(); 71 72 73 public boolean useDoubleQuotes4DDLNames(); 74 75 81 public void onInitRepository(Repository rep) throws SQLException; 82 83 86 public void onDeleteRepository(Repository rep) throws SQLException; 87 88 91 public void onInitConnection() throws SQLException; 92 93 102 public void start() throws RepositoryException; 103 104 105 public void rollback() throws SQLException; 106 107 122 public void commit() throws RepositoryException; 123 124 132 public TableInfo createQueryTemporaryTable() throws SQLException; 133 134 140 public String createTemporaryTableAs(String subQuery) throws SQLException; 141 142 146 public String getTemporaryTableName(); 147 148 152 public TableInfo getTemporaryTableInfo(); 153 154 159 public void dropTemporaryTable(String tableName) throws SQLException; 160 161 165 public void dropTemporaryTables() throws SQLException; 166 167 172 public void dropTable(String tableName) throws SQLException; 173 174 179 public Map getTableMetadata(String tableName) throws SQLException; 180 181 187 public void addBatch(PreparedStatement stmt) throws SQLException; 188 189 193 public void addBatch(Statement stmt, String SQLStatement) throws SQLException; 194 195 201 public int[] executeBatch(Statement stmt) throws SQLException; 202 203 208 public void setFetchSize(Statement stmt, int rows) throws SQLException; 209 210 214 public boolean checkTable(String name) throws SQLException; 215 216 220 public boolean checkTable(TableInfo table) throws SQLException; 221 222 224 public void emptyTable(String tableName) throws SQLException; 225 229 public String getDeleteUserTableRowsStatement(String deletionStmt, String documentRowsSelectionClause) 230 throws SQLException, RepositoryException; 231 232 public void executeRangeUpdate(String statement, long first, long last) 233 throws SQLException, RepositoryException; 234 235 244 public String getColumnStatement(int type) throws RepositoryException; 245 public int UNKNOW_ERROR_CODE = 0; 249 public int OBJECT_ALREADY_EXISTS = 1; 250 public int OBJECT_DOES_NOT_EXISTS = 2; 251 252 public int getUniversalError(SQLException e); 253 254 public void updateStatistics(String tableName) throws SQLException; 258 259 public int getMaxDataLength(); 260 public int getSystemCollectionDataLength(); 261 public boolean useStringDelimitor(); 262 public boolean distinguishNullAndEmptyStrings(); 263 264 public String getTemporaryTableCreationStatement(TableInfo table); 265 266 public String getIndexOrganizedTableCreationStatement(TableInfo table); 267 268 public String getLockSelectStatement(String columnList, String tableName, String filterClause); 269 public String getLockSelectStatement(TableInfo table, String filterClause); 270 271 public String getBitmapIndexClause(); 272 273 public String getHashIndexClause(); 274 275 public String getBTreeIndexClause(); 276 277 public void executeUpdate(String stmt) throws SQLException; 278 279 public void createSequence(TableInfo table, short step) throws SQLException; 280 public void dropSequence(String seqName) throws SQLException; 281 282 public long nextSequenceValue(TableInfo table, short step) throws RepositoryException; 283 284 290 public Collection createTables(Collection tables) throws SQLException; 291 292 public void createIndexes(Collection tables) throws SQLException; 293 294 public void dropIndexes(Collection tables) throws SQLException; 295 296 301 public List getUserTableNames(String tablePattern) throws SQLException; 302 public List getUserSequenceNames(String seqPattern) throws SQLException; 303 304 public void setObject(PreparedStatement pStmt, int index, Object o, int javaType, DbType sqlType) 305 throws SQLException; 306 } 307 | Popular Tags |