1 21 22 package org.apache.derby.jdbc; 23 24 import java.sql.DatabaseMetaData ; 25 import org.apache.derby.iapi.jdbc.BrokeredConnection; 26 import org.apache.derby.iapi.jdbc.BrokeredConnectionControl; 27 import org.apache.derby.iapi.jdbc.BrokeredConnection40; 28 import org.apache.derby.iapi.sql.ResultSet; 29 import org.apache.derby.iapi.services.sanity.SanityManager; 30 import org.apache.derby.iapi.error.StandardException; 31 import org.apache.derby.impl.jdbc.EmbedConnection; 32 import org.apache.derby.impl.jdbc.EmbedConnection30; 33 import org.apache.derby.impl.jdbc.EmbedPreparedStatement40; 34 import org.apache.derby.impl.jdbc.EmbedCallableStatement40; 35 import org.apache.derby.impl.jdbc.EmbedConnection40; 36 import org.apache.derby.impl.jdbc.EmbedResultSet; 37 import org.apache.derby.impl.jdbc.EmbedResultSet40; 38 import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData40; 39 import org.apache.derby.impl.jdbc.SQLExceptionFactory40; 40 import org.apache.derby.impl.jdbc.EmbedStatement40; 41 import org.apache.derby.impl.jdbc.EmbedResultSetMetaData40; 42 import org.apache.derby.impl.jdbc.Util; 43 import java.sql.Connection ; 44 import java.sql.SQLException ; 45 import java.sql.CallableStatement ; 46 import java.sql.PreparedStatement ; 47 import java.util.Properties ; 48 import org.apache.derby.iapi.sql.ResultColumnDescriptor; 49 50 51 public class Driver40 extends Driver30 { 52 53 public Connection getNewNestedConnection(EmbedConnection conn) { 54 if (SanityManager.DEBUG) { 55 SanityManager.ASSERT(conn instanceof EmbedConnection30, 56 "conn expected to be instanceof EmbedConnection30"); 57 } 58 return new EmbedConnection40(conn); 59 } 60 61 62 public EmbedConnection getNewEmbedConnection(String url, Properties info) 63 throws SQLException { 64 return new EmbedConnection40(this, url, info); 65 } 66 67 78 public java.sql.Statement newEmbedStatement( 79 EmbedConnection conn, 80 boolean forMetaData, 81 int resultSetType, 82 int resultSetConcurrency, 83 int resultSetHoldability) 84 { 85 return new EmbedStatement40(conn, forMetaData, resultSetType, resultSetConcurrency, 86 resultSetHoldability); 87 } 88 89 public PreparedStatement 90 newEmbedPreparedStatement( 91 EmbedConnection conn, 92 String stmt, 93 boolean forMetaData, 94 int resultSetType, 95 int resultSetConcurrency, 96 int resultSetHoldability, 97 int autoGeneratedKeys, 98 int[] columnIndexes, 99 String [] columnNames) 100 throws SQLException { 101 return new EmbedPreparedStatement40(conn, 102 stmt, 103 forMetaData, 104 resultSetType, 105 resultSetConcurrency, 106 resultSetHoldability, 107 autoGeneratedKeys, 108 columnIndexes, 109 columnNames); 110 } 111 112 113 public CallableStatement newEmbedCallableStatement( 114 EmbedConnection conn, 115 String stmt, 116 int resultSetType, 117 int resultSetConcurrency, 118 int resultSetHoldability) 119 throws SQLException { 120 return new EmbedCallableStatement40(conn, 121 stmt, 122 resultSetType, 123 resultSetConcurrency, 124 resultSetHoldability); 125 } 126 public BrokeredConnection newBrokeredConnection(BrokeredConnectionControl control) { 127 128 return new BrokeredConnection40(control); 129 } 130 131 public EmbedResultSet newEmbedResultSet(EmbedConnection conn, ResultSet results, boolean forMetaData, org.apache.derby.impl.jdbc.EmbedStatement statement,boolean isAtomic) throws SQLException { 132 return new EmbedResultSet40(conn, results, forMetaData, statement, 133 isAtomic); 134 } 135 136 140 141 public void boot(boolean create, Properties properties) 142 throws StandardException { 143 Util.setExceptionFactory (new SQLExceptionFactory40 ()); 144 super.boot (create, properties); 145 } 146 147 public DatabaseMetaData newEmbedDatabaseMetaData(EmbedConnection conn, String dbname) 148 throws SQLException { 149 return new EmbedDatabaseMetaData40(conn,dbname); 150 } 151 152 159 public EmbedResultSetMetaData40 newEmbedResultSetMetaData 160 (ResultColumnDescriptor[] columnInfo) { 161 return new EmbedResultSetMetaData40(columnInfo); 162 } 163 } 164 | Popular Tags |