org.apache.james.util.mordred
Class PoolConnEntry

java.lang.Object
  |
  +--org.apache.james.util.mordred.PoolConnEntry
All Implemented Interfaces:
Connection

public class PoolConnEntry
extends Object
implements Connection

An entry in a connection pool.

Author:
Serge Knystautas

Field Summary
static int ACTIVE
           
static int AVAILABLE
           
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
PoolConnEntry(JdbcDataSource container, Connection conn, int id)
          Insert the method's description here.
 
Method Summary
 void clearWarnings()
          Simple method to log any warnings on an entry (connection), and then clear them.
 void close()
           
 void commit()
           
 Statement createStatement()
           
 Statement createStatement(int resultSetType, int resultSetConcurrency)
           
protected  void finalize()
          Need to clean up the connection
 boolean getAutoCommit()
           
 String getCatalog()
           
 long getCreateDate()
          Insert the method's description here.
 int getId()
          Insert the method's description here.
 long getLastActivity()
          Insert the method's description here.
 long getLockTime()
          Insert the method's description here.
 DatabaseMetaData getMetaData()
           
 int getStatus()
          Insert the method's description here.
 String getString()
           
 Throwable getTrace()
          Insert the method's description here.
 int getTransactionIsolation()
           
 Map getTypeMap()
           
 SQLWarning getWarnings()
           
 boolean isClosed()
          Returns whether this entry is closed.
 boolean isReadOnly()
           
 boolean lock()
          Locks an entry for anybody else using it
 String nativeSQL(String sql)
           
 CallableStatement prepareCall(String sql)
           
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
           
 PreparedStatement prepareStatement(String sql)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
           
 void rollback()
           
 void setAutoCommit(boolean autoCommit)
           
 void setCatalog(String catalog)
           
 void setReadOnly(boolean readOnly)
           
 void setTransactionIsolation(int level)
           
 void setTypeMap(Map map)
           
 void unlock()
          Resets flags on an entry for reuse in the pool
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Connection
createStatement, getHoldability, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setHoldability, setSavepoint, setSavepoint
 

Field Detail

AVAILABLE

public static final int AVAILABLE
See Also:
Constant Field Values

ACTIVE

public static final int ACTIVE
See Also:
Constant Field Values
Constructor Detail

PoolConnEntry

public PoolConnEntry(JdbcDataSource container,
                     Connection conn,
                     int id)
Insert the method's description here. Creation date: (8/24/99 11:43:45 AM)

Parameters:
conn - java.sql.Connection
Method Detail

lock

public boolean lock()
             throws SQLException
Locks an entry for anybody else using it

SQLException

unlock

public void unlock()
Resets flags on an entry for reuse in the pool


clearWarnings

public void clearWarnings()
Simple method to log any warnings on an entry (connection), and then clear them.

Specified by:
clearWarnings in interface Connection
Throws:
SQLException

getCreateDate

public long getCreateDate()
Insert the method's description here. Creation date: (8/24/99 11:43:19 AM)

Returns:
a long representing the time this entry was created

getId

public int getId()
Insert the method's description here. Creation date: (8/24/99 12:09:01 PM)

Returns:
int

getLastActivity

public long getLastActivity()
Insert the method's description here. Creation date: (8/24/99 11:43:19 AM)

Returns:
long

getLockTime

public long getLockTime()
Insert the method's description here. Creation date: (8/24/99 11:43:19 AM)

Returns:
long

getStatus

public int getStatus()
Insert the method's description here. Creation date: (8/24/99 11:43:19 AM)

Returns:
int

getTrace

public Throwable getTrace()
Insert the method's description here. Creation date: (8/24/99 2:33:38 PM)

Returns:
java.lang.Throwable

finalize

protected void finalize()
Need to clean up the connection

Overrides:
finalize in class Object

getString

public String getString()

close

public void close()
           throws SQLException
Specified by:
close in interface Connection
SQLException

isClosed

public boolean isClosed()
                 throws SQLException
Returns whether this entry is closed.

Specified by:
isClosed in interface Connection
Returns:
whether the underlying conntection is closed
SQLException

createStatement

public final Statement createStatement()
                                throws SQLException
Specified by:
createStatement in interface Connection
SQLException

prepareStatement

public final PreparedStatement prepareStatement(String sql)
                                         throws SQLException
Specified by:
prepareStatement in interface Connection
SQLException

prepareCall

public final CallableStatement prepareCall(String sql)
                                    throws SQLException
Specified by:
prepareCall in interface Connection
SQLException

nativeSQL

public final String nativeSQL(String sql)
                       throws SQLException
Specified by:
nativeSQL in interface Connection
SQLException

setAutoCommit

public final void setAutoCommit(boolean autoCommit)
                         throws SQLException
Specified by:
setAutoCommit in interface Connection
SQLException

getAutoCommit

public final boolean getAutoCommit()
                            throws SQLException
Specified by:
getAutoCommit in interface Connection
SQLException

commit

public final void commit()
                  throws SQLException
Specified by:
commit in interface Connection
SQLException

rollback

public final void rollback()
                    throws SQLException
Specified by:
rollback in interface Connection
SQLException

getMetaData

public final DatabaseMetaData getMetaData()
                                   throws SQLException
Specified by:
getMetaData in interface Connection
SQLException

setReadOnly

public final void setReadOnly(boolean readOnly)
                       throws SQLException
Specified by:
setReadOnly in interface Connection
SQLException

isReadOnly

public final boolean isReadOnly()
                         throws SQLException
Specified by:
isReadOnly in interface Connection
SQLException

setCatalog

public final void setCatalog(String catalog)
                      throws SQLException
Specified by:
setCatalog in interface Connection
SQLException

getCatalog

public final String getCatalog()
                        throws SQLException
Specified by:
getCatalog in interface Connection
SQLException

setTransactionIsolation

public final void setTransactionIsolation(int level)
                                   throws SQLException
Specified by:
setTransactionIsolation in interface Connection
SQLException

getTransactionIsolation

public final int getTransactionIsolation()
                                  throws SQLException
Specified by:
getTransactionIsolation in interface Connection
SQLException

getWarnings

public final SQLWarning getWarnings()
                             throws SQLException
Specified by:
getWarnings in interface Connection
SQLException

createStatement

public final Statement createStatement(int resultSetType,
                                       int resultSetConcurrency)
                                throws SQLException
Specified by:
createStatement in interface Connection
SQLException

prepareStatement

public final PreparedStatement prepareStatement(String sql,
                                                int resultSetType,
                                                int resultSetConcurrency)
                                         throws SQLException
Specified by:
prepareStatement in interface Connection
SQLException

prepareCall

public final CallableStatement prepareCall(String sql,
                                           int resultSetType,
                                           int resultSetConcurrency)
                                    throws SQLException
Specified by:
prepareCall in interface Connection
SQLException

getTypeMap

public final Map getTypeMap()
                     throws SQLException
Specified by:
getTypeMap in interface Connection
SQLException

setTypeMap

public final void setTypeMap(Map map)
                      throws SQLException
Specified by:
setTypeMap in interface Connection
SQLException


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."