1 21 22 package org.apache.derby.client.net; 23 24 import java.rmi.UnexpectedException ; 25 import java.sql.Connection ; 26 import java.sql.SQLException ; 27 import org.apache.derby.client.ClientPooledConnection; 28 import org.apache.derby.client.am.CallableStatement; 29 import org.apache.derby.client.am.ClientJDBCObjectFactory; 30 import org.apache.derby.client.am.LogicalConnection; 31 import org.apache.derby.client.am.ParameterMetaData; 32 import org.apache.derby.client.am.PreparedStatement; 33 import org.apache.derby.client.am.Configuration; 34 import org.apache.derby.client.am.LogWriter; 35 import org.apache.derby.client.am.Agent; 36 import org.apache.derby.client.am.Section; 37 import org.apache.derby.client.am.Statement; 38 import org.apache.derby.client.am.SqlException; 39 import org.apache.derby.client.am.Cursor; 40 import org.apache.derby.jdbc.ClientBaseDataSource; 41 import org.apache.derby.client.am.ColumnMetaData; 42 43 49 50 public class ClientJDBCObjectFactoryImpl implements ClientJDBCObjectFactory{ 51 54 public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds, 55 LogWriter logWriter,String user, 56 String password) throws SQLException { 57 return new ClientPooledConnection(ds,logWriter,user,password); 58 } 59 62 public ClientPooledConnection newClientPooledConnection(ClientBaseDataSource ds, 63 LogWriter logWriter,String user, 64 String password,int rmId) throws SQLException { 65 return new ClientPooledConnection(ds,logWriter,user,password,rmId); 66 } 67 85 public CallableStatement newCallableStatement(Agent agent, 86 org.apache.derby.client.am.Connection connection, 87 String sql,int type,int concurrency, 88 int holdability,ClientPooledConnection cpc) throws SqlException { 89 return new CallableStatement(agent,connection,sql,type, 90 concurrency,holdability,cpc); 91 } 92 93 96 public LogicalConnection newLogicalConnection( 97 org.apache.derby.client.am.Connection physicalConnection, 98 ClientPooledConnection pooledConnection) 99 throws SqlException { 100 return new LogicalConnection(physicalConnection, pooledConnection); 101 } 102 103 125 public PreparedStatement newPreparedStatement(Agent agent, 126 org.apache.derby.client.am.Connection connection, 127 String sql,Section section,ClientPooledConnection cpc) 128 throws SqlException { 129 return new PreparedStatement(agent,connection,sql,section,cpc); 130 } 131 132 162 public PreparedStatement newPreparedStatement(Agent agent, 163 org.apache.derby.client.am.Connection connection, 164 String sql,int type,int concurrency,int holdability, 165 int autoGeneratedKeys,String [] columnNames, 166 ClientPooledConnection cpc) 167 throws SqlException { 168 return new PreparedStatement(agent,connection,sql,type,concurrency, 169 holdability,autoGeneratedKeys,columnNames,cpc); 170 } 171 172 175 public org.apache.derby.client.am.Connection newNetConnection( 176 org.apache.derby.client.am.LogWriter netLogWriter, 177 String databaseName,java.util.Properties properties) 178 throws SqlException { 179 return (org.apache.derby.client.am.Connection) 180 (new NetConnection((NetLogWriter)netLogWriter,databaseName,properties)); 181 } 182 185 public org.apache.derby.client.am.Connection newNetConnection( 186 org.apache.derby.client.am.LogWriter netLogWriter, 187 org.apache.derby.jdbc.ClientBaseDataSource clientDataSource, 188 String user,String password) throws SqlException { 189 return (org.apache.derby.client.am.Connection) 190 (new NetConnection((NetLogWriter)netLogWriter,clientDataSource 191 ,user,password)); 192 } 193 196 public org.apache.derby.client.am.Connection newNetConnection( 197 org.apache.derby.client.am.LogWriter netLogWriter, 198 int driverManagerLoginTimeout,String serverName, 199 int portNumber,String databaseName, 200 java.util.Properties properties) throws SqlException { 201 return (org.apache.derby.client.am.Connection) 202 (new NetConnection((NetLogWriter)netLogWriter,driverManagerLoginTimeout, 203 serverName,portNumber,databaseName,properties)); 204 } 205 208 public org.apache.derby.client.am.Connection newNetConnection( 209 org.apache.derby.client.am.LogWriter netLogWriter,String user, 210 String password, 211 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 212 int rmId,boolean isXAConn) throws SqlException { 213 return (org.apache.derby.client.am.Connection) 214 (new NetConnection((NetLogWriter)netLogWriter,user,password,dataSource,rmId, 215 isXAConn)); 216 } 217 220 public org.apache.derby.client.am.Connection newNetConnection( 221 org.apache.derby.client.am.LogWriter netLogWriter, 222 String ipaddr,int portNumber, 223 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 224 boolean isXAConn) throws SqlException { 225 return (org.apache.derby.client.am.Connection) 226 new NetConnection((NetLogWriter)netLogWriter,ipaddr,portNumber,dataSource, 227 isXAConn); 228 } 229 246 public org.apache.derby.client.am.Connection newNetConnection( 247 org.apache.derby.client.am.LogWriter netLogWriter,String user, 248 String password, 249 org.apache.derby.jdbc.ClientBaseDataSource dataSource, 250 int rmId,boolean isXAConn, 251 ClientPooledConnection cpc) throws SqlException { 252 return (org.apache.derby.client.am.Connection) 253 (new NetConnection((NetLogWriter)netLogWriter,user,password,dataSource,rmId, 254 isXAConn,cpc)); 255 } 256 259 public org.apache.derby.client.am.ResultSet newNetResultSet(Agent netAgent, 260 org.apache.derby.client.am.MaterialStatement netStatement, 261 Cursor cursor, 262 int qryprctyp,int sqlcsrhld,int qryattscr,int qryattsns, 263 int qryattset,long qryinsid,int actualResultSetType, 264 int actualResultSetConcurrency, 265 int actualResultSetHoldability) throws SqlException { 266 return new NetResultSet((NetAgent)netAgent, 267 (NetStatement)netStatement,cursor,qryprctyp,sqlcsrhld,qryattscr, 268 qryattsns,qryattset,qryinsid,actualResultSetType, 269 actualResultSetConcurrency,actualResultSetHoldability); 270 } 271 274 public org.apache.derby.client.am.DatabaseMetaData newNetDatabaseMetaData(Agent netAgent, 275 org.apache.derby.client.am.Connection netConnection) { 276 return new NetDatabaseMetaData((NetAgent)netAgent, 277 (NetConnection)netConnection); 278 } 279 280 288 public Statement newStatement(Agent agent, org.apache.derby.client.am.Connection connection) 289 throws SqlException { 290 return new Statement(agent,connection); 291 } 292 293 306 public Statement newStatement(Agent agent, 307 org.apache.derby.client.am.Connection connection, int type, 308 int concurrency, int holdability, 309 int autoGeneratedKeys, String [] columnNames) 310 throws SqlException { 311 return new Statement(agent,connection,type,concurrency,holdability, 312 autoGeneratedKeys,columnNames); 313 } 314 315 322 public ColumnMetaData newColumnMetaData(LogWriter logWriter) { 323 return new ColumnMetaData(logWriter); 324 } 325 326 335 public ColumnMetaData newColumnMetaData(LogWriter logWriter, int upperBound) { 336 return new ColumnMetaData(logWriter,upperBound); 337 } 338 339 347 public ParameterMetaData newParameterMetaData(ColumnMetaData columnMetaData) { 348 return new ParameterMetaData(columnMetaData); 349 } 350 } 351 | Popular Tags |