planetj.database.connection
Class DataSourceWrapper

java.lang.Object
  extended byplanetj.database.connection.DataSourceWrapper
All Implemented Interfaces:
DataEngineDataSource, javax.sql.DataSource

public class DataSourceWrapper
extends java.lang.Object
implements DataEngineDataSource

Wraps a DataSource object in DataEngineDataSource interface


Constructor Summary
DataSourceWrapper(javax.sql.DataSource ds, java.lang.String userID, java.lang.String password)
          DataSourceWrapper constructor
 
Method Summary
 java.sql.Connection getConnection()
          Gets a connection out of the proxied datasource.
 java.sql.Connection getConnection(java.lang.String sql)
          Gets a Connection which will be used to execute the specified SQL.
 java.sql.Connection getConnection(java.lang.String userID, java.lang.String password)
          getConnection method comment.
 int getLoginTimeout()
          getLoginTimeout method comment.
 java.io.PrintWriter getLogWriter()
          getLogWriter method comment.
 void setLoginTimeout(int arg1)
          setLoginTimeout method comment.
 void setLogWriter(java.io.PrintWriter arg1)
          setLogWriter method comment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceWrapper

public DataSourceWrapper(javax.sql.DataSource ds,
                         java.lang.String userID,
                         java.lang.String password)
DataSourceWrapper constructor

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets a connection out of the proxied datasource.

Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String sql)
                                  throws DataEngineException
Gets a Connection which will be used to execute the specified SQL. The returned Connection may be chosen from all of the available connections based on the SQL statement passed in

Specified by:
getConnection in interface DataEngineDataSource
Throws:
DataEngineException

getConnection

public java.sql.Connection getConnection(java.lang.String userID,
                                         java.lang.String password)
                                  throws java.sql.SQLException
getConnection method comment.

Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
getLoginTimeout method comment.

Specified by:
getLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
getLogWriter method comment.

Specified by:
getLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int arg1)
                     throws java.sql.SQLException
setLoginTimeout method comment.

Specified by:
setLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter arg1)
                  throws java.sql.SQLException
setLogWriter method comment.

Specified by:
setLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException