net.xoetrope.optional.data.sql
Class ConnectionObject

java.lang.Object
  extended by net.xoetrope.optional.pool.PoolObject
      extended by net.xoetrope.optional.data.sql.ConnectionObject
Direct Known Subclasses:
NamedConnectionObject

public class ConnectionObject
extends PoolObject

A wrapper for a connection for use by a ConnectionManager

Copyright (c) Xoetrope Ltd. 2001-2003

$Revision: 2.3 $ License: see license.txt


Constructor Summary
ConnectionObject(java.sql.Connection conn, PoolManager pool)
          Constructs a new connection object
 
Method Summary
 void close()
          Return the connection to the connection manager
 java.sql.Connection getConnection()
          Get a reference to the Connection.
DO NOT RETAIN A REFERENCE TO THE RETURNED OBJECT
 boolean validate()
          Check to see if a connection can be made and is still in a working state
 
Methods inherited from class net.xoetrope.optional.pool.PoolObject
expireLease, getInUse, getLastUse, lease
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionObject

public ConnectionObject(java.sql.Connection conn,
                        PoolManager pool)
Constructs a new connection object

Parameters:
conn - a JDBC connection
pool - the pool manager
Method Detail

validate

public boolean validate()
Check to see if a connection can be made and is still in a working state

Specified by:
validate in class PoolObject
Returns:
true if the connection is still working

close

public void close()
           throws java.lang.Exception
Return the connection to the connection manager

Specified by:
close in class PoolObject
Throws:
java.lang.Exception - possible exceptions while trying to close the JDBC connection object

getConnection

public java.sql.Connection getConnection()
Get a reference to the Connection.
DO NOT RETAIN A REFERENCE TO THE RETURNED OBJECT

Returns:
possible JDBC exceptions while attempting to establish a connection