public class IMSDataSource extends Object implements 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 |
---|---|
Connection |
getConnection()
Attempts to establish a connection with the data source that this
DataSource object represents.
|
Connection |
getConnection(String username,
String password)
Attempts to establish a connection with the data source that this
DataSource object represents.
|
String |
getDatabaseName()
Retrieves the database name this DataSource is configured to access.
|
String |
getDatastoreName()
Retrieves name of the IMS datastore this DataSource is configured to
access.
|
String |
getDatastoreServer()
Retrieves the name or IP address of your datastore server (IMS Connect).
|
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.
|
String |
getInitStatusGroup() |
String |
getKeyStoreType()
Gets SSL key store type.
|
protected boolean |
getLLField() |
int |
getLoginTimeout()
Retrieves the login timeout for this DataSource object
|
PrintWriter |
getLogWriter()
Retrieves the log writer for this DataSource object.
|
String |
getMetadataURL()
Deprecated.
|
Logger |
getParentLogger() |
String |
getPassword()
Retrieves the user password for RACF authentication.
|
int |
getPortNumber()
Retrieves the port number.
|
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.
|
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.
|
String |
getSSLKeyMgrAlgorithm()
Gets SSL key manager algorithm.
|
String |
getSSLKeyStoreLocation()
Gets SSL key store path.
|
String |
getSSLKeyStorePassword()
Gets SSL key store password.
|
String |
getSSLTrustMgrAlgorithm()
Gets SSL trust manager algorithm.
|
String |
getSSLTrustStoreLocation()
Gets SSL trust store path.
|
String |
getSSLTrustStorePassword()
Gets SSL trust store password.
|
boolean |
getTreatIncompleteFieldAsNull()
Gets the option to treat incomplete field data as null.
|
String |
getUser()
Retrieves the user name for RACF authentication.
|
boolean |
isWrapperFor(Class<?> iface)
This function is not supported.
|
void |
setDatabaseName(String databaseName)
Sets the name of the target IMS database to be accessed.
|
void |
setDatastoreName(String datastoreName)
Sets the name of the IMS datastore to access.
|
void |
setDatastoreServer(String datastoreServer)
Sets the name or IP address of the datastore server (IMS Connect).
|
void |
setDescription(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(String host) |
void |
setInitStatusGroup(String initStatusGroup) |
void |
setKeyStoreType(String keyStoreType)
Sets SSL key store type.
|
protected void |
setLLField(boolean llField) |
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(PrintWriter out)
Sets the log writer for this
DataSource object to the
given java.io.PrintWriter object. |
void |
setMetadataURL(String metadataURL)
Deprecated.
|
void |
setPassword(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(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(String secureSocketProtocol)
Sets secure socket protocol type.
|
void |
setServerName(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(String keyMgrAlgorithm)
Sets SSL key manager algorithm.
|
void |
setSSLKeyStoreLocation(String keyStoreLocation)
Sets SSL key store path.
|
void |
setSSLKeyStorePassword(String keyStorePassword)
Sets SSL key store password.
|
void |
setSSLTrustMgrAlgorithm(String trustMgrAlgorithm)
Sets SSL trust manager algorithm.
|
void |
setSSLTrustStoreLocation(String trustStoreLocation)
Sets SSL trust store path.
|
void |
setSSLTrustStorePassword(String trustStorePassword)
Sets SSL trust store password.
|
void |
setTreatIncompleteFieldAsNull(boolean treatIncompleteFieldAsNull)
Sets the option to treat incomplete field data as null.
|
void |
setUser(String user)
Sets the user name for RACF authentication.
|
String |
toString() |
<T> T |
unwrap(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 Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
username
- the database user on whose behalf the connection is being madepassword
- the user's passwordSQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws 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 CommonDataSource
out
- the new log writer; to disable logging, set to nullSQLException
public void setLoginTimeout(int seconds)
DataSource
object is created, the login timeout is initially zero.setLoginTimeout
in interface CommonDataSource
seconds
- the data source login time limitpublic void setUser(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 String getUser()
public void setPassword(String password)
password
- User password valuepublic String getPassword()
public void setProperties(Properties properties) throws 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 PropertiesSQLException
public Properties getProperties()
public void setDatastoreServer(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 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(String trustStoreLocation)
trustStoreLocation
- Fully qualified path to the key store file containing the trusted certificate from IMS Connect.public void setSSLTrustStorePassword(String trustStorePassword)
trustStorePassword
- Password set for the key store file using keytool.public void setSSLTrustMgrAlgorithm(String trustMgrAlgorithm)
trustMgrAlgorithm
- public void setSSLKeyStoreLocation(String keyStoreLocation)
keyStoreLocation
- Fully qualified path to the key store file containing the client's certificate and private key.public void setSSLKeyStorePassword(String keyStorePassword)
keyStorePassword
- Password set for the key store file using keytool.public void setSSLKeyMgrAlgorithm(String keyMgrAlgorithm)
keyMgrAlgorithm
- public void setKeyStoreType(String keyStoreType)
keyStoreType
- Valid values include "JKS" or "PKCS12".public void setSecureSocketProtocol(String secureSocketProtocol)
secureSocketProtocol
- Valid values include "SSL", "SSLv3", "TLSv1.1", "TLSv1.2", etc.public boolean getSSLConnection()
public String getSSLTrustStoreLocation()
public String getSSLTrustStorePassword()
public String getSSLTrustMgrAlgorithm()
public String getSSLKeyStoreLocation()
public String getSSLKeyStorePassword()
public String getSSLKeyMgrAlgorithm()
public String getKeyStoreType()
public String getSecureSocketProtocol()
public void setMetadataURL(String metadataURL)
setDatabaseName(String)
metadataURL
- metadata urlpublic String getMetadataURL()
getDatabaseName()
public void setDescription(String description)
description
- the descriptionpublic String getDescription()
public void setDatastoreName(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 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(String databaseName)
databaseName
- database namepublic String getDatabaseName()
protected boolean getLLField()
protected void setLLField(boolean llField)
public String getInitStatusGroup()
public void setInitStatusGroup(String initStatusGroup)
public boolean isWrapperFor(Class<?> iface) throws 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 Wrapper
iface
- a Class defining an interfaceSQLException
- if an error occurs while determining whether this is a wrapper for an object with the given interfacepublic <T> T unwrap(Class<T> iface) throws 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 Wrapper
iface
- a Class defining an interface that the result must implementSQLException
- If no object found that implements the interfacepublic void setServerName(String serverName)
public void setHost(String host)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
(c) Copyright IBM Corporation 2008, 2017.