|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.rds.ClientDataSource
A IMSJdbcDataSource provides a mechanism to create a Connection from
an object stored in the JNDI namespace. The DataSource object is
either deployed into the name space by a deployment tool, such as
that for WebSphere Application Server, or it can be deployed by an application different
from the application using the DataSource. IMSJdbcDataSource
can also be created directly in an application, rather than loading it
from the name space. The following code snippet demonstrates how to
create an IMS DataSource
from an
IMSJdbcManagedConnectionFactory
and use it to create a
Connection
:
IMSJdbcDataSource implements both the Serializable and Referenceable interfaces, although the Referenceable interface is currently only supported in a managed-server environment.IMSJdbcManagedConnectionFactory mcf = new IMSJdbcManagedConnectionFactory(); mcf.setDatabaseViewName("MyDatabaseView"); mcf.setDRAName("IMS1"); DataSource dataSource = (DataSource)mcf.createConnectionFactory(); Connection connection = dataSource.getConnection();
IMSJdbcManagedConnectionFactory
,
Connection
,
ManagedConnectionFactory
,
ConnectionManager
,
Reference
,
Referenceable
, Serialized FormConstructor Summary | |
ClientDataSource()
|
|
ClientDataSource(javax.resource.spi.ConnectionManager connectionManager,
ClientManagedConnectionFactory managedConnectionFactory)
|
Method Summary | |
java.sql.Connection |
getConnection()
Gets a connection from the application server on behalf of the client. |
java.sql.Connection |
getConnection(java.lang.String userid,
java.lang.String password)
This function is not supported |
java.lang.String |
getDatabaseViewName()
Returns the name of the DLIDatabaseView used by this DataSource object. |
java.lang.String |
getDRAName()
Returns the DRA name of the IMS system this datasource is using. |
java.lang.String |
getHostName()
Returns the name (or IP address) of the host machine. |
int |
getLoginTimeout()
This function is not supported |
java.io.PrintWriter |
getLogWriter()
Gets the PrintWriter contained in the associated
IMSJdbcManagedConnectionFactory if one exists. |
java.lang.Integer |
getPortNumber()
Returns the IIOP port number of the host machine's web server. |
javax.naming.Reference |
getReference()
Returns stored reference. |
void |
setDatabaseViewName(java.lang.String databaseViewName)
Sets the fully-qualified name of the DLIDatabaseView to be used by this DataSource object. |
void |
setDRAName(java.lang.String draName)
Sets the DRA name of the IMS system for this datasource |
void |
setHostName(java.lang.String hostName)
Sets the name of the of the host machine. |
void |
setLoginTimeout(int timeout)
This method is not currently supported. |
void |
setLogWriter(java.io.PrintWriter printWriter)
This method is not currently supported as tracing is enabled at the ManagedConnectionFactory level and filtered down to the DataSource. |
void |
setPortNumber(java.lang.Integer portNumber)
Sets the IIOP port number of the of the host machine's web server. |
void |
setReference(javax.naming.Reference reference)
Stores a reference. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClientDataSource()
public ClientDataSource(javax.resource.spi.ConnectionManager connectionManager, ClientManagedConnectionFactory managedConnectionFactory)
Method Detail |
public final java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
Connection
object.java.sql.Exception
- an SQLException
that was thrown from the resource adapter's
attempt to get a connection.Connection
public final java.sql.Connection getConnection(java.lang.String userid, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
userid
- not used.password
- not used.java.sql.SQLException
- a java.sql.SQLException
indicating the method is
not supported.Connection
public java.lang.String getDatabaseViewName()
public void setDatabaseViewName(java.lang.String databaseViewName)
databaseViewName
- the fully-qualified DLIDatabaseView subclasspublic java.lang.String getDRAName()
public void setDRAName(java.lang.String draName)
draName
- the 4 character DRA IDpublic java.lang.String getHostName()
public void setHostName(java.lang.String hostName)
hostName
- the name (or IP address) of the host machine.public java.lang.Integer getPortNumber()
public void setPortNumber(java.lang.Integer portNumber)
portNumber
- the port number of the host machine.public void setReference(javax.naming.Reference reference)
reference
- the JNDI Reference to be stored.Reference
public javax.naming.Reference getReference()
getReference
in interface javax.naming.Referenceable
Reference
public final java.io.PrintWriter getLogWriter() throws java.sql.SQLException
PrintWriter
contained in the associated
IMSJdbcManagedConnectionFactory
if one exists.getLogWriter
in interface javax.sql.DataSource
java.io.PrintWriter
to the client.java.sql.SQLException
- an SQLException
that was thrown from the resource
adapter's attempt to retrieve the PrintWriter.ManagedConnectionFactory.getLogWriter()
,
PrintWriter
public final int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
- Throws an SQLException indicating the method is
not supported.public final void setLogWriter(java.io.PrintWriter printWriter) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
- an SQLException
indicating the method is
not supported.public final void setLoginTimeout(int timeout) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.DataSource
timeout
- not used.java.sql.SQLException
- an SQLException
indicating the method is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |