1 21 22 package org.apache.derby.impl.tools.ij; 23 24 import org.apache.derby.iapi.reference.JDBC20Translation; 25 import org.apache.derby.iapi.reference.JDBC30Translation; 26 27 import java.util.Hashtable ; 28 import java.sql.Connection ; 29 import java.sql.SQLException ; 30 import java.sql.Statement ; 31 32 import org.apache.derby.iapi.tools.i18n.LocalizedOutput; 33 40 class utilMain14 extends utilMain 41 { 42 private static final String JDBC_NOTSUPPORTED = "JDBC 3 method called - not yet supported"; 43 49 utilMain14(int numConnections, LocalizedOutput out) 50 throws ijFatalException 51 { 52 super(numConnections, out, (Hashtable )null); 53 } 54 55 68 utilMain14(int numConnections, LocalizedOutput out, Hashtable ignoreErrors) 69 throws ijFatalException 70 { 71 super(numConnections, out, ignoreErrors); 72 } 73 74 84 Connection setHoldability(Connection conn, int holdType) 85 throws SQLException 86 { 87 conn.setHoldability(holdType); 88 return conn; 89 } 90 91 101 int getHoldability(Connection conn) 102 throws SQLException 103 { 104 return conn.getHoldability(); 105 } 106 107 116 Statement createStatement(Connection conn, int scrollType, int holdType) 117 throws SQLException 118 { 119 Statement stmt; 120 try { 121 stmt = conn.createStatement(scrollType, JDBC20Translation.CONCUR_READ_ONLY, holdType); 122 }catch(SQLException se) { 123 if (isJCC && se.getMessage().equals(JDBC_NOTSUPPORTED)) 125 stmt = conn.createStatement(scrollType, JDBC20Translation.CONCUR_READ_ONLY); 126 else 127 throw se; 128 } 129 catch(AbstractMethodError ame) { 130 if (isJCC) 134 stmt = conn.createStatement(scrollType, JDBC20Translation.CONCUR_READ_ONLY); 135 else 136 stmt = conn.createStatement(); 137 } 138 return stmt; 139 } 140 141 } 142 | Popular Tags |