1 21 22 package org.apache.derby.client.net; 23 24 import org.apache.derby.client.ClientPooledConnection; 25 import org.apache.derby.client.ClientPooledConnection40; 26 import org.apache.derby.client.am.CallableStatement; 27 import org.apache.derby.client.am.CallableStatement40; 28 import org.apache.derby.client.am.ColumnMetaData; 29 import org.apache.derby.client.am.ColumnMetaData40; 30 import org.apache.derby.client.am.ClientJDBCObjectFactory; 31 import org.apache.derby.client.am.LogicalConnection; 32 import org.apache.derby.client.am.LogicalConnection40; 33 import org.apache.derby.client.am.PreparedStatement; 34 import org.apache.derby.client.am.PreparedStatement40; 35 import org.apache.derby.client.am.ParameterMetaData; 36 import org.apache.derby.client.am.ParameterMetaData40; 37 import org.apache.derby.client.am.LogWriter; 38 import org.apache.derby.client.am.Agent; 39 import org.apache.derby.client.am.SQLExceptionFactory40; 40 import org.apache.derby.client.am.Section; 41 import org.apache.derby.client.am.Statement; 42 import org.apache.derby.client.am.Statement40; 43 import org.apache.derby.client.am.SqlException; 44 import org.apache.derby.client.am.Cursor; 45 import org.apache.derby.jdbc.ClientDataSource; 46 import java.sql.SQLException ; 47 import org.apache.derby.jdbc.ClientBaseDataSource; 48 49 53 public class ClientJDBCObjectFactoryImpl40 implements ClientJDBCObjectFactory{ 54 55 59 public ClientJDBCObjectFactoryImpl40 () { 60 SqlException.setExceptionFactory (new SQLExceptionFactory40 ()); 61 } 62 65 public ClientPooledConnection newClientPooledConnection( 66 ClientBaseDataSource ds, LogWriter logWriter,String user, 67 String password) throws SQLException { 68 return new ClientPooledConnection40(ds,logWriter,user,password); 69 } 70 73 public ClientPooledConnection newClientPooledConnection( 74 ClientBaseDataSource ds, LogWriter logWriter,String user, 75 String password,int rmId) throws SQLException { 76 return new ClientPooledConnection40(ds,logWriter,user,password,rmId); 77 } 78 96 public CallableStatement newCallableStatement(Agent agent, 97 org.apache.derby.client.am.Connection connection, 98 String sql,int type,int concurrency, 99 int holdability,ClientPooledConnection cpc) throws SqlException { 100 return new CallableStatement40(agent,connection,sql,type,concurrency, 101 holdability,cpc); 102 } 103 108 public LogicalConnection newLogicalConnection( 109 org.apache.derby.client.am.Connection physicalConnection, 110 ClientPooledConnection pooledConnection) 111 throws SqlException { 112 return new LogicalConnection40(physicalConnection, pooledConnection); 113 } 114 115 118 public PreparedStatement newPreparedStatement(Agent agent, 119 org.apache.derby.client.am.Connection connection, 120 String sql,Section section,ClientPooledConnection cpc) 121 throws SqlException { 122 return new PreparedStatement40(agent,connection,sql,section,cpc); 123 } 124 125 155 public PreparedStatement newPreparedStatement(Agent agent, 156 org.apache.derby.client.am.Connection connection, 157 String sql,int type,int concurrency, 158 int holdability,int autoGeneratedKeys, 159 String [] columnNames,ClientPooledConnection cpc) 160 throws SqlException { 161 return new PreparedStatement40(agent,connection,sql,type,concurrency, 162 holdability,autoGeneratedKeys,columnNames,cpc); 163 } 164 165 166 169 public org.apache.derby.client.am.Connection newNetConnection 170 (org.apache.derby.client.am.LogWriter netLogWriter, 171 String databaseName,java.util.Properties properties) 172 throws SqlException { 173 return (org.apache.derby.client.am.Connection) 174 (new NetConnection40((NetLogWriter)netLogWriter,databaseName,properties)); 175 } 176 179 public org.apache.derby.client.am.Connection newNetConnection 180 (org.apache.derby.client.am.LogWriter netLogWriter, 181 org.apache.derby.jdbc.ClientBaseDataSource clientDataSource, 182 String user,String password) throws SqlException { 183 return (org.apache.derby.client.am.Connection) 184 (new NetConnection40((NetLogWriter)netLogWriter,clientDataSource,user,password)); 185 } 186 189 public org.apache.derby.client.am.Connection 190 newNetConnection(org.apache.derby.client.am.LogWriter netLogWriter, 191 int driverManagerLoginTimeout,String serverName, 192 int portNumber,String databaseName, 193 java.util.Properties properties) throws SqlException { 194 return (org.apache.derby.client.am.Connection) 195 (new NetConnection40((NetLogWriter)netLogWriter,driverManagerLoginTimeout, 196 serverName,portNumber,databaseName,properties)); 197 } 198 201 public org.apache.derby.client.am.Connection 202 newNetConnection(org.apache.derby.client.am.LogWriter netLogWriter, 203 String user, 204 String password, 205 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 206 int rmId,boolean isXAConn) throws SqlException { 207 return (org.apache.derby.client.am.Connection) 208 (new NetConnection40((NetLogWriter)netLogWriter,user,password,dataSource, 209 rmId,isXAConn)); 210 } 211 214 public org.apache.derby.client.am.Connection 215 newNetConnection(org.apache.derby.client.am.LogWriter netLogWriter, 216 String ipaddr,int portNumber, 217 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 218 boolean isXAConn) throws SqlException { 219 return (org.apache.derby.client.am.Connection) 220 (new NetConnection40((NetLogWriter)netLogWriter,ipaddr,portNumber,dataSource, 221 isXAConn)); 222 } 223 239 public org.apache.derby.client.am.Connection newNetConnection( 240 org.apache.derby.client.am.LogWriter netLogWriter,String user, 241 String password, 242 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 243 int rmId,boolean isXAConn,ClientPooledConnection cpc) 244 throws SqlException { 245 return (org.apache.derby.client.am.Connection) 246 (new NetConnection40((NetLogWriter)netLogWriter,user,password,dataSource,rmId, 247 isXAConn,cpc)); 248 249 } 250 253 public org.apache.derby.client.am.ResultSet newNetResultSet(Agent netAgent, 254 org.apache.derby.client.am.MaterialStatement netStatement, 255 Cursor cursor,int qryprctyp,int sqlcsrhld, 256 int qryattscr,int qryattsns,int qryattset,long qryinsid, 257 int actualResultSetType,int actualResultSetConcurrency, 258 int actualResultSetHoldability) throws SqlException { 259 return new NetResultSet40((NetAgent)netAgent,(NetStatement)netStatement, 260 cursor, 261 qryprctyp, sqlcsrhld, qryattscr, qryattsns, qryattset, qryinsid, 262 actualResultSetType,actualResultSetConcurrency, 263 actualResultSetHoldability); 264 } 265 268 public org.apache.derby.client.am.DatabaseMetaData newNetDatabaseMetaData(Agent netAgent, 269 org.apache.derby.client.am.Connection netConnection) { 270 return new NetDatabaseMetaData40((NetAgent)netAgent, 271 (NetConnection)netConnection); 272 } 273 274 282 public Statement newStatement(Agent agent, org.apache.derby.client.am.Connection connection) 283 throws SqlException { 284 return new Statement40(agent,connection); 285 } 286 287 300 public Statement newStatement(Agent agent, 301 org.apache.derby.client.am.Connection connection, int type, 302 int concurrency, int holdability, 303 int autoGeneratedKeys, String [] columnNames) 304 throws SqlException { 305 return new Statement40(agent,connection,type,concurrency,holdability, 306 autoGeneratedKeys,columnNames); 307 } 308 309 316 public ColumnMetaData newColumnMetaData(LogWriter logWriter) { 317 return new ColumnMetaData40(logWriter); 318 } 319 320 329 public ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound) { 330 return new ColumnMetaData40(logWriter,upperBound); 331 } 332 333 341 public ParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData) { 342 return new ParameterMetaData40(columnMetaData); 343 } 344 } 345 | Popular Tags |