org.w3c.tools.jdbc
Class JdbcConnection

java.lang.Object
  extended by org.w3c.tools.jdbc.JdbcConnection
All Implemented Interfaces:
LRUAble

public class JdbcConnection
extends java.lang.Object
implements LRUAble


Field Summary
static boolean debug
           
protected  LRUAble lru_next
           
protected  LRUAble lru_prev
           
static int QUERY_TIMEOUT
           
protected  long querystamp
           
protected  JdbcServer server
          The server this connection is attached to.
 
Method Summary
 void close()
           
 void delete()
          Close (if necessary) and delete this connection.
 java.sql.DatabaseMetaData getMetaData()
           
 LRUAble getNext()
          LRUAble interface - Get previous item in the LRU list.
 LRUAble getPrev()
          LRUAble interface - Get next item in the LRU list.
 long getQueryStamp()
           
protected  JdbcServer getServer()
           
 boolean isClosed()
           
 boolean markUsed()
          Mark the connection used.
 java.sql.ResultSet performQuery(java.lang.String command)
           
 int performUpdate(java.lang.String command)
           
 void setNext(LRUAble next)
          LRUAble interface - Set the next item for this server.
 void setPrev(LRUAble prev)
          LRUAble interface - Set the previous item for this server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values

QUERY_TIMEOUT

public static final int QUERY_TIMEOUT
See Also:
Constant Field Values

querystamp

protected long querystamp

lru_next

protected LRUAble lru_next

lru_prev

protected LRUAble lru_prev

server

protected JdbcServer server
The server this connection is attached to.

Method Detail

getNext

public LRUAble getNext()
LRUAble interface - Get previous item in the LRU list.

Specified by:
getNext in interface LRUAble
Returns:
The previous item, or null.

getPrev

public LRUAble getPrev()
LRUAble interface - Get next item in the LRU list.

Specified by:
getPrev in interface LRUAble
Returns:
The next item, or null.

setNext

public void setNext(LRUAble next)
LRUAble interface - Set the next item for this server.

Specified by:
setNext in interface LRUAble

setPrev

public void setPrev(LRUAble prev)
LRUAble interface - Set the previous item for this server.

Specified by:
setPrev in interface LRUAble

getServer

protected final JdbcServer getServer()

markUsed

public boolean markUsed()
Mark the connection used.

Returns:
true if the connection is usable, false otherwise.

performQuery

public java.sql.ResultSet performQuery(java.lang.String command)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

performUpdate

public int performUpdate(java.lang.String command)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getQueryStamp

public long getQueryStamp()

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

delete

public void delete()
Close (if necessary) and delete this connection.


close

public void close()

isClosed

public boolean isClosed()