org.logicalcobwebs.proxool
Class ProxyFactory

java.lang.Object
  extended byorg.logicalcobwebs.proxool.ProxyFactory

class ProxyFactory
extends java.lang.Object

A central place to build proxy objects (connections and statements).

Since:
Proxool 0.5
Version:
$Revision: 1.25 $, $Date: 2003/12/12 19:29:47 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Field Summary
private static Log LOG
           
 
Constructor Summary
(package private) ProxyFactory()
           
 
Method Summary
protected static ProxyConnection buildProxyConnection(long id, ConnectionPool connectionPool, int status)
           
protected static java.sql.Statement createProxyStatement(java.sql.Statement delegate, ConnectionPool connectionPool, ProxyConnectionIF proxyConnection, java.lang.String sqlStatement)
           
protected static java.sql.Connection getConnection(ProxyConnectionIF proxyConnection)
          Get a Connection from the ProxyConnection
protected static java.sql.DatabaseMetaData getDatabaseMetaData(java.sql.Connection connection, ProxyConnectionIF proxyConnection)
          Create a new DatabaseMetaData from a connection
static java.sql.Connection getDelegateConnection(java.sql.Connection connection)
          Gets the real Connection that we got from the delegate driver
protected static java.sql.Statement getDelegateStatement(java.sql.Statement statement)
          Gets the real Statement that we got from the delegate driver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG
Constructor Detail

ProxyFactory

ProxyFactory()
Method Detail

buildProxyConnection

protected static ProxyConnection buildProxyConnection(long id,
                                                      ConnectionPool connectionPool,
                                                      int status)
                                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getConnection

protected static java.sql.Connection getConnection(ProxyConnectionIF proxyConnection)
Get a Connection from the ProxyConnection

Parameters:
proxyConnection - where to find the connection
Returns:

getDelegateStatement

protected static java.sql.Statement getDelegateStatement(java.sql.Statement statement)
Gets the real Statement that we got from the delegate driver

Parameters:
statement - proxy statement
Returns:
delegate statement

getDelegateConnection

public static java.sql.Connection getDelegateConnection(java.sql.Connection connection)
Gets the real Connection that we got from the delegate driver

Parameters:
connection - proxy connection
Returns:
deletgate connection

createProxyStatement

protected static java.sql.Statement createProxyStatement(java.sql.Statement delegate,
                                                         ConnectionPool connectionPool,
                                                         ProxyConnectionIF proxyConnection,
                                                         java.lang.String sqlStatement)

getDatabaseMetaData

protected static java.sql.DatabaseMetaData getDatabaseMetaData(java.sql.Connection connection,
                                                               ProxyConnectionIF proxyConnection)
                                                        throws java.sql.SQLException
Create a new DatabaseMetaData from a connection

Parameters:
connection - the proxy connection we are using
Returns:
databaseMetaData
Throws:
java.sql.SQLException - if the delegfate connection couldn't get the metaData