com.ibm.u2.jdbcx
Class UniJDBCDataSource

java.lang.Object
  |
  +--com.ibm.u2.jdbcx.UniJDBCCoreDataSource
        |
        +--com.ibm.u2.jdbcx.UniJDBCDataSource
All Implemented Interfaces:
javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable

public class UniJDBCDataSource
extends UniJDBCCoreDataSource
implements javax.sql.DataSource, javax.naming.Referenceable

UniJDBCDataSource class is the IBM Universe/Unidata implementation of javax.sql.DataSource.

See Also:
DataSource, UniJDBCCoreDataSource, Serialized Form

Fields inherited from class com.ibm.u2.jdbcx.UniJDBCCoreDataSource
DSProperties, mMsgFactory, password, user, value
 
Constructor Summary
UniJDBCDataSource()
          Allocates an empty UniJDBCDataSource object.
UniJDBCDataSource(UniJDBCConnectionPoolDataSource lcpds)
          Allocates an UniJDBCDataSource object using the properties of the input ConnectionPoolDataSource.
 
Method Summary
 java.sql.Connection getConnection()
          Attempts to establish a connection to the data source that this DataSource object represents.
 java.sql.Connection getConnection(java.lang.String luser, java.lang.String lpassword)
          Attempts to establish a connection to the data source that this DataSource object represents.
 UniJDBCConnectionPoolDataSource getCPDS()
           
 int getCPMFreeCount()
           
 javax.naming.Reference getReference()
          This method implements the Referenceable interface.
 
Methods inherited from class com.ibm.u2.jdbcx.UniJDBCCoreDataSource
addProp, getAccount, getCountry, getDataSourceName, getDBMSType, getDescription, getDsProperties, getLanguage, getLoginTimeout, getLogWriter, getMsgFactory, getNetworkType, getODBCConfigURL, getODBCDSName, getPassword, getProp, getServerHost, getServerPort, getService, getTraceFile, getTraceLevel, getUser, readProperties, removeProperty, setAccount, setCountry, setDataSourceName, setDBMSType, setDescription, setLanguage, setLoginTimeout, setLogWriter, setNetworkType, setODBCConfigURL, setODBCDSName, setPassword, setServerHost, setServerPort, setService, setTraceFile, setTraceLevel, setUser, writeProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.DataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

UniJDBCDataSource

public UniJDBCDataSource()
                  throws java.sql.SQLException
Allocates an empty UniJDBCDataSource object.
Throws:
java.sql.SQLException - if error is encountered while instantiating the object.

UniJDBCDataSource

public UniJDBCDataSource(UniJDBCConnectionPoolDataSource lcpds)
                  throws java.sql.SQLException
Allocates an UniJDBCDataSource object using the properties of the input ConnectionPoolDataSource.
Parameters:
lcpds - the ConnectionPoolDataSource object that contains the properties needed to make the physical connection.
Throws:
java.sql.SQLException - if error is encountered while instantiating the object.
See Also:
UniJDBCConnectionPoolDataSource
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Attempts to establish a connection to the data source that this DataSource object represents.
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException - if a database-access error occurs.

getConnection

public java.sql.Connection getConnection(java.lang.String luser,
                                         java.lang.String lpassword)
                                  throws java.sql.SQLException
Attempts to establish a connection to the data source that this DataSource object represents.
Specified by:
getConnection in interface javax.sql.DataSource
Parameters:
user - the data source user on whose behalf the connection is being made.
password - the user's password.
Throws:
java.sql.SQLException - if a database-access error occurs.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
This method implements the Referenceable interface. Perhaps it should be called, makeReference. It is used by the naming service provider to create a reference object that embodies enough information about this datasource such that the datasource can be recreated when naming.lookup() is called. This reference is only used internally by the naming service. It is eventually bound to a user specified name (in naming.bind()) and subsequently, it is used to reconstruct the datasource when naming.lookup() is called with the given name.
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
reference to the datasource.

getCPMFreeCount

public int getCPMFreeCount()

getCPDS

public UniJDBCConnectionPoolDataSource getCPDS()