1 22 23 package org.xquark.mapper.dbms.microsoft; 24 25 import java.sql.*; 26 27 import org.xquark.jdbc.typing.DBMSInfo; 28 import org.xquark.mapper.RepositoryException; 29 import org.xquark.mapper.dbms.JDBC2Connection; 30 31 35 public class SQS2000Connection extends JDBC2Connection 36 { 37 private static final String RCSRevision = "$Revision: 1.2 $"; 38 private static final String RCSName = "$Name: $"; 39 40 41 42 public SQS2000Connection(Connection connection, short dbms, DBMSInfo dbmsInfo) 43 throws SQLException 44 { 45 super(connection, dbms, dbmsInfo); 46 } 47 48 protected void setSchemaName() throws SQLException 49 { 50 Statement stmt = null; 51 try { 52 stmt = connection.createStatement(); 53 ResultSet rs = stmt.executeQuery("select CURRENT_USER"); if (rs.next()) 55 schemaName = rs.getString(1); 56 rs.close(); 57 } 58 finally { 59 stmt.close(); 60 } 61 } 62 63 public void dropTemporaryTable(String tableName) throws SQLException 67 { 68 super.dropTemporaryTable("#" + tableName); 69 } 70 71 public String getDeleteUserTableRowsStatement(String tableName, String documentRowsSelectionClause) 72 throws SQLException, RepositoryException 73 { 74 StringBuffer deletionStmt = new StringBuffer (); 75 deletionStmt.append("DELETE "); 76 deletionStmt.append(tableName); 77 deletionStmt.append(' '); 78 deletionStmt.append(documentRowsSelectionClause); 79 81 return deletionStmt.toString(); 82 } 83 84 86 public boolean useStringDelimitor() 87 { 88 return false; 89 } 92 93 public void onInitConnection() throws SQLException 94 { 95 executeUpdate("SET ANSI_DEFAULTS ON"); 96 } 97 98 103 } 104 | Popular Tags |