DODS 7.2 API

com.lutris.appserver.server.sql.datasource
Class SimpleDataSourceDBConnection

java.lang.Object
  extended by com.lutris.appserver.server.sql.ExtendedDBConnection
      extended by com.lutris.appserver.server.sql.datasource.SimpleDataSourceDBConnection
All Implemented Interfaces:
DBConnection

public class SimpleDataSourceDBConnection
extends ExtendedDBConnection


Field Summary
protected  javax.sql.DataSource ds
           
 
Fields inherited from class com.lutris.appserver.server.sql.ExtendedDBConnection
allocated, closed, connection, connectionAllocator, connectionEnterPoolTime, connectionUsageCounter, currentStmt, dropConnection, dropped, generation, id, logging, maxPreparedStmts, nextId, password, preparedStmtCache, prepareStatementCache, psCacheLatency, reset, url, user
 
Constructor Summary
protected SimpleDataSourceDBConnection(ConnectionAllocator connectionAllocatorObj, javax.sql.DataSource dataSource, int maxPreparedStatements, boolean logging, int generation)
          Initialize the connection to a database.
  SimpleDataSourceDBConnection(ConnectionAllocator connectionAllocatorObj, java.lang.String url, java.lang.String user, java.lang.String password, int maxPreparedStatements, boolean logging, int generation)
          Initialize the connection to a database.
 
Method Summary
 void release()
          Return this connection to its allocator.
 
Methods inherited from class com.lutris.appserver.server.sql.ExtendedDBConnection
allocate, allocatedCheck, allocateObjectId, close, closedCheck, commit, drop, execute, executeQuery, executeQuery, executeUpdate, executeUpdate, getConnection, getConnectionEnterPoolTime, getConnectionUsageCounter, getDatabaseName, getGeneration, getMaxPreparedStmts, getResultSetConcurrency, getResultSetType, getUrl, getUser, handleException, incrRequestCount, isClosed, isDroped, isMarkedForDrop, logDebug, logDebug, prepareCall, prepareStatement, prepareStatement, prepareStatement, reset, resetCheck, rollback, setAutoCommit, setConnectionEnterPoolTime, setConnectionUsageCounter, validate, warningCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ds

protected javax.sql.DataSource ds
Constructor Detail

SimpleDataSourceDBConnection

public SimpleDataSourceDBConnection(ConnectionAllocator connectionAllocatorObj,
                                    java.lang.String url,
                                    java.lang.String user,
                                    java.lang.String password,
                                    int maxPreparedStatements,
                                    boolean logging,
                                    int generation)
                             throws java.sql.SQLException
Initialize the connection to a database.

Parameters:
url - JDBC URL of database.
user - SQL user name.
password - SQL password.
connectionAllocatorObj - The connection allocator that this connection belongs to.
maxPreparedStatements - Maximum number of preparse statements. a value of less than zero queries JDBC for the value.
logging - Specifying true enables SQL logging.
generation - A generation number used to drop old connection when they are released.
Throws:
java.sql.SQLException - If a connection can't be established.

SimpleDataSourceDBConnection

protected SimpleDataSourceDBConnection(ConnectionAllocator connectionAllocatorObj,
                                       javax.sql.DataSource dataSource,
                                       int maxPreparedStatements,
                                       boolean logging,
                                       int generation)
                                throws java.sql.SQLException
Initialize the connection to a database.

Parameters:
dataSource - DataSource object.
connectionAllocatorObj - The connection allocator that this connection belongs to.
maxPreparedStatements - Maximum number of preparse statements. a value of less than zero queries JDBC for the value.
logging - Specifying true enables SQL logging.
generation - A generation number used to drop old connection when they are released.
Throws:
java.sql.SQLException - If a connection can't be established.
Method Detail

release

public void release()
Return this connection to its allocator. This object should not be used after calling this function.

Specified by:
release in interface DBConnection
Specified by:
release in class ExtendedDBConnection

DODS 7.2 API