public class IMSDataSource
extends java.lang.Object
implements javax.sql.DataSource
javax.sql.DataSource
interface for the IMS Universal JDBC
driver.Modifier and Type | Field and Description |
---|---|
static int |
DRIVER_TYPE_2
Constant indicating usage of the type 2 driver
|
static int |
DRIVER_TYPE_4
Constant indicating usage of the type 4 driver
|
static short |
TRACE_ALL
Constant indicating to turn on all Universal driver tracing
|
static short |
TRACE_DLI
Constant indicating to turn on DLI layer tracing
|
static short |
TRACE_DRDA
Constant indicating to turn on DRDA layer tracing
|
static short |
TRACE_JDBC
Constant indicating to turn on JDBC layer tracing
|
static short |
TRACE_JEE
Constant indicating to turn on JEE layer tracing
|
Constructor and Description |
---|
IMSDataSource()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Attempts to establish a connection with the data source that this
DataSource object represents.
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Attempts to establish a connection with the data source that this
DataSource object represents.
|
java.lang.String |
getDatabaseName()
Retrieves the database name this DataSource is configured to access.
|
java.lang.String |
getDatastoreName()
Retrieves name of the IMS datastore this DataSource is configured to
access.
|
java.lang.String |
getDatastoreServer()
Retrieves the name or IP address of your datastore server (IMS Connect).
|
java.lang.String |
getDescription()
Retrieves the description of this DataSource.
|
int |
getDriverType()
Retrieves the database connectivity method.
|
boolean |
getExpandArrayResultSet()
Returns the option to expand or not expand the ResultSet of a column with data
type ARRAY.
|
java.lang.String |
getInitStatusGroup() |
java.lang.String |
getKeyStoreType()
Gets SSL key store type.
|
int |
getLoginTimeout()
Retrieves the login timeout for this DataSource object
|
java.io.PrintWriter |
getLogWriter()
Retrieves the log writer for this DataSource object.
|
java.lang.String |
getMetadataURL()
Deprecated.
|
java.util.logging.Logger |
getParentLogger() |
java.lang.String |
getPassword()
Retrieves the user password for RACF authentication.
|
int |
getPortNumber()
Retrieves the port number.
|
java.util.Properties |
getProperties()
Retrieves the Connection Properties.
|
boolean |
getRemoveInvalidCaseFields()
Returns the option to whether to remove the map case fields that don't satisfy the DEPENDINGON
field condition in the WHERE clause from the column's list in the result set.
|
boolean |
getReturnResultOnStatusCodeGE()
Sets the option to return the trailing partial data retrieved from a batchRetrieve or SELECT statement that received a GE status code.
|
java.lang.String |
getSecureSocketProtocol()
Gets SSL protocol.
|
boolean |
getSsaOptimization()
Returns the option to whether to optimize the SSA or not
When set to true the SSA will be optimized to a fully qualified key if subfields of that key are provided. |
boolean |
getSSLConnection()
Retrieves the SSL connectivity.
|
java.lang.String |
getSSLKeyMgrAlgorithm()
Gets SSL key manager algorithm.
|
java.lang.String |
getSSLKeyStoreLocation()
Gets SSL key store path.
|
java.lang.String |
getSSLKeyStorePassword()
Gets SSL key store password.
|
java.lang.String |
getSSLTrustMgrAlgorithm()
Gets SSL trust manager algorithm.
|
java.lang.String |
getSSLTrustStoreLocation()
Gets SSL trust store path.
|
java.lang.String |
getSSLTrustStorePassword()
Gets SSL trust store password.
|
boolean |
getTreatIncompleteFieldAsNull()
Gets the option to treat incomplete field data as null.
|
java.lang.String |
getUser()
Retrieves the user name for RACF authentication.
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
This function is not supported.
|
void |
setDatabaseName(java.lang.String databaseName)
Sets the name of the target IMS database to be accessed.
|
void |
setDatastoreName(java.lang.String datastoreName)
Sets the name of the IMS datastore to access.
|
void |
setDatastoreServer(java.lang.String datastoreServer)
Sets the name or IP address of the datastore server (IMS Connect).
|
void |
setDescription(java.lang.String description)
Sets the description of this DataSource.
|
void |
setDriverType(int driverType)
Sets the type of driver to use to connect to the database.
|
void |
setExpandArrayResultSet(boolean expandArrayResultSet)
Sets the option to expand or not expand the ResultSet of a column with data
type ARRAY.
|
void |
setHost(java.lang.String host) |
void |
setInitStatusGroup(java.lang.String initStatusGroup) |
void |
setKeyStoreType(java.lang.String keyStoreType)
Sets SSL key store type.
|
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while
attempting to connect to a database.
|
void |
setLogWriter(java.io.PrintWriter out)
Sets the log writer for this
DataSource object to the
given java.io.PrintWriter object. |
void |
setMetadataURL(java.lang.String metadataURL)
Deprecated.
|
void |
setPassword(java.lang.String password)
Sets the user password for RACF authentication.
|
void |
setPortNumber(int portNumber)
Sets the port number to be used to communicate with IMS Connect.
|
void |
setProperties(java.util.Properties properties)
Sets connection properties that are not part of the standard DataSource interface:
dbspOncommit : Set this property to true to deallocate the PSB when a commit occurs.
fetchSize : Gives the client a hint as to the number of rows that should be fetched from the
database when more rows are needed. |
void |
setRemoveInvalidCaseFields(boolean removeInvalidCaseFields)
Sets the option to whether to remove the map case fields that don't satisfy the DEPENDINGON
field condition in the WHERE clause from the column's list in the result set.
|
void |
setReturnResultOnStatusCodeGE(boolean returnResultOnStatusCodeGE)
Sets the option to return the trailing partial data retrieved from a batchRetrieve or SELECT statement that received a GE status code.
|
void |
setSecureSocketProtocol(java.lang.String secureSocketProtocol)
Sets secure socket protocol type.
|
void |
setServerName(java.lang.String serverName) |
void |
setSsaOptimization(boolean ssaOptimization)
Sets the option to whether to optimize the SSA or not
When set to true the SSA will be optimized to a fully qualified key if subfields of that key are provided. |
void |
setSSLConnection(boolean sslConnection)
Sets SSL encryption on or off.
|
void |
setSSLKeyMgrAlgorithm(java.lang.String keyMgrAlgorithm)
Sets SSL key manager algorithm.
|
void |
setSSLKeyStoreLocation(java.lang.String keyStoreLocation)
Sets SSL key store path.
|
void |
setSSLKeyStorePassword(java.lang.String keyStorePassword)
Sets SSL key store password.
|
void |
setSSLTrustMgrAlgorithm(java.lang.String trustMgrAlgorithm)
Sets SSL trust manager algorithm.
|
void |
setSSLTrustStoreLocation(java.lang.String trustStoreLocation)
Sets SSL trust store path.
|
void |
setSSLTrustStorePassword(java.lang.String trustStorePassword)
Sets SSL trust store password.
|
void |
setTreatIncompleteFieldAsNull(boolean treatIncompleteFieldAsNull)
Sets the option to treat incomplete field data as null.
|
void |
setUser(java.lang.String user)
Sets the user name for RACF authentication.
|
java.lang.String |
toString() |
<T> T |
unwrap(java.lang.Class<T> iface)
This function is no supported.
|
public static final int DRIVER_TYPE_4
public static final int DRIVER_TYPE_2
public static final short TRACE_ALL
public static final short TRACE_DRDA
public static final short TRACE_DLI
public static final short TRACE_JDBC
public static final short TRACE_JEE
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
username
- the database user on whose behalf the connection is being madepassword
- the user's passwordjava.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
DataSource
object to the
given java.io.PrintWriter
object. The log writer is a
character output stream to which all logging and tracing messages for
this data source will be printed. This includes messages printed by the
methods of this object, messages printed by methods of other objects
manufactured by this object, and so on. Messages printed to a data
source- specific log writer are not printed to the log writer associated
with the java.sql.Drivermanager
class. When a
DataSource
object is created the log writer is initially
null; in other words, the default is for logging to be disabled.setLogWriter
in interface javax.sql.CommonDataSource
out
- the new log writer; to disable logging, set to nulljava.sql.SQLException
public void setLoginTimeout(int seconds)
DataSource
object is created, the login timeout is initially zero.setLoginTimeout
in interface javax.sql.CommonDataSource
seconds
- the data source login time limitpublic void setUser(java.lang.String user)
user
- User name.public void setExpandArrayResultSet(boolean expandArrayResultSet)
expandArrayResultSet
- public boolean getExpandArrayResultSet()
expandArrayResultSet
- public void setSsaOptimization(boolean ssaOptimization)
ssaOptimization
- public boolean getSsaOptimization()
ssaOptimization
- public void setRemoveInvalidCaseFields(boolean removeInvalidCaseFields)
removeInvalidCaseFields
- public boolean getRemoveInvalidCaseFields()
public void setReturnResultOnStatusCodeGE(boolean returnResultOnStatusCodeGE)
returnResultOnStatusCodeGE
- public boolean getTreatIncompleteFieldAsNull()
public void setTreatIncompleteFieldAsNull(boolean treatIncompleteFieldAsNull)
treatIncompleteFieldAsNull
- public boolean getReturnResultOnStatusCodeGE()
public java.lang.String getUser()
public void setPassword(java.lang.String password)
password
- User password valuepublic java.lang.String getPassword()
public void setProperties(java.util.Properties properties) throws java.sql.SQLException
dbspOncommit
: Set this property to true to deallocate the PSB when a commit occurs.fetchSize
: Gives the client a hint as to the number of rows that should be fetched from the
database when more rows are needed. The number of rows specified affects only data returned using this
connection. If the value specified is zero, the hint is ignored.llfield
: Setting this property to true exposes the LL field data as a normal column in the result set.maxRows
: Specifies the maximum number of rows to return in a query result set.traceFile
: Specifies the name of the trace file for the connection.traceFileAppend
: If the specified trace file already exists, setting this property to true specifies
that the trace data for the new connection should be appended to the existing trace file rather than overwriting it.traceDirectory
: Specifies the file system directory where the trace file is located.traceLevel
: Specifies the trace level for the connection.These properties are optional.
properties
- Connection Propertiesjava.sql.SQLException
public java.util.Properties getProperties()
public void setDatastoreServer(java.lang.String datastoreServer)
NOTE: Only used for Type-4 connectivity. Does not apply for Type-2.
datastoreServer
- name or IP address of the datastore server (IMS Connect)public java.lang.String getDatastoreServer()
public void setPortNumber(int portNumber)
NOTE: Only used for Type-4 connectivity. Does not apply for Type-2.
portNumber
- port numberpublic int getPortNumber()
public void setSSLConnection(boolean sslConnection)
sslConnection
- Set to true
to turn SSL encryption on.public void setSSLTrustStoreLocation(java.lang.String trustStoreLocation)
trustStoreLocation
- Fully qualified path to the key store file containing the trusted certificate from IMS Connect.public void setSSLTrustStorePassword(java.lang.String trustStorePassword)
trustStorePassword
- Password set for the key store file using keytool.public void setSSLTrustMgrAlgorithm(java.lang.String trustMgrAlgorithm)
trustMgrAlgorithm
- public void setSSLKeyStoreLocation(java.lang.String keyStoreLocation)
keyStoreLocation
- Fully qualified path to the key store file containing the client's certificate and private key.public void setSSLKeyStorePassword(java.lang.String keyStorePassword)
keyStorePassword
- Password set for the key store file using keytool.public void setSSLKeyMgrAlgorithm(java.lang.String keyMgrAlgorithm)
keyMgrAlgorithm
- public void setKeyStoreType(java.lang.String keyStoreType)
keyStoreType
- Valid values include "JKS" or "PKCS12".public void setSecureSocketProtocol(java.lang.String secureSocketProtocol)
secureSocketProtocol
- Valid values include "SSL", "SSLv3", "TLSv1.1", "TLSv1.2", etc.public boolean getSSLConnection()
public java.lang.String getSSLTrustStoreLocation()
public java.lang.String getSSLTrustStorePassword()
public java.lang.String getSSLTrustMgrAlgorithm()
public java.lang.String getSSLKeyStoreLocation()
public java.lang.String getSSLKeyStorePassword()
public java.lang.String getSSLKeyMgrAlgorithm()
public java.lang.String getKeyStoreType()
public java.lang.String getSecureSocketProtocol()
public void setMetadataURL(java.lang.String metadataURL)
setDatabaseName(String)
metadataURL
- metadata urlpublic java.lang.String getMetadataURL()
getDatabaseName()
public void setDescription(java.lang.String description)
description
- the descriptionpublic java.lang.String getDescription()
public void setDatastoreName(java.lang.String datastoreName)
For Type-2 connectivity: The datastore parameter refers to the 1 to 4 character identifier of the DRA startup table member. The member name structure is DFSxxxx0 where xxxx is the member identifier. Example: datastore parameter = SYS1 refers to DRA startup table member DFSSYS10 The ODBA startup table is a user created member that contains the IMS subsystem connection properties which includes the IMS subsystem id. This is not required to be set for the Java Dependent Region runtime.
datastoreName
- IMS datastore namepublic java.lang.String getDatastoreName()
public void setDriverType(int driverType)
driverType
- Supported values are IMSDataSource.DRIVER_TYPE_4
and IMSDataSource.DRIVER_TYPE_2
public int getDriverType()
public void setDatabaseName(java.lang.String databaseName)
databaseName
- database namepublic java.lang.String getDatabaseName()
public java.lang.String getInitStatusGroup()
public void setInitStatusGroup(java.lang.String initStatusGroup)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
on the wrapped object. If
this does not implement the interface and is not a wrapper,
return false. This method should be implemented as a low-cost
operation compared to unwrap
so that callers can use this method
to avoid expensive unwrap
calls that may fail. If this method
returns true then calling unwrap
with the same argument should
succeed.isWrapperFor
in interface java.sql.Wrapper
iface
- a Class defining an interfacejava.sql.SQLException
- if an error occurs while determining whether this is a wrapper for an object with the given interfacepublic <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
recursively on the wrapped object or a proxy for that
result. If the receiver is not a wrapper and does not implement
the interface, then an SQLException
is thrown.unwrap
in interface java.sql.Wrapper
iface
- a Class defining an interface that the result must implementjava.sql.SQLException
- If no object found that implements the interfacepublic void setServerName(java.lang.String serverName)
public void setHost(java.lang.String host)
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException