com.ibm.as400.access
Class AS400JDBCDataSource
java.lang.Object
|
+--com.ibm.as400.access.AS400JDBCDataSource
- All Implemented Interfaces:
- javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable
- Direct Known Subclasses:
- AS400JDBCConnectionPoolDataSource, AS400JDBCXADataSource
- public class AS400JDBCDataSource
- extends java.lang.Object
- implements javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable
The AS400JDBCDataSource class represents a factory for AS/400 or iSeries database connections.
The following is an example that creates an AS400JDBCDataSource object and creates a
connection to the database.
// Create a data source for making the connection.
AS400JDBCDataSource datasource = new AS400JDBCDataSource("myAS400");
datasource.setUser("myUser");
datasource.setPassword("MYPWD");
// Create a database connection to the AS/400 or iSeries.
Connection connection = datasource.getConnection();
The following example registers an AS400JDBCDataSource object with JNDI and then
uses the object returned from JNDI to obtain a database connection.
// Create a data source to the AS/400 or iSeries database.
AS400JDBCDataSource dataSource = new AS400JDBCDataSource();
dataSource.setServerName("myAS400");
// Register the datasource with the Java Naming and Directory Interface (JNDI).
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
Context context = new InitialContext(env);
context.bind("jdbc/customer", dataSource);
// Return an AS400JDBCDataSource object from JNDI and get a connection.
AS400JDBCDataSource datasource = (AS400JDBCDataSource) context.lookup("jdbc/customer");
Connection connection = datasource.getConnection("myUser", "MYPWD");
- See Also:
- Serialized Form
Constructor Summary |
AS400JDBCDataSource()
Constructs a default AS40JDBCDataSource object. |
AS400JDBCDataSource(java.lang.String serverName)
Constructs an AS400JDBCDataSource object to the specified serverName. |
AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password)
Constructs an AS400JDBCDataSource object with the specified signon information. |
AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password,
java.lang.String keyRingName,
java.lang.String keyRingPassword)
Constructs an AS400JDBCDataSource object with the specified signon information
to use for SSL communications with the server. |
Method Summary |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
java.lang.String |
getAccess()
Returns the level of database access for the AS/400 or iSeries connection. |
int |
getBidiStringType()
Returns the output string type of bidi data, as defined by the CDRA
(Character Data Representation Architecture). |
int |
getBlockCriteria()
Returns the criteria for retrieving data from the AS/400 or iSeries server in
blocks of records. |
int |
getBlockSize()
Returns the block size in kilobytes to retrieve from the AS/400 or iSeries server and
cache on the client. |
java.sql.Connection |
getConnection()
Returns the database connection. |
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
Returns the database connection using the specified user and password. |
java.lang.String |
getDatabaseName()
Returns the database name property. |
java.lang.String |
getDataSourceName()
Returns the data source name property. |
java.lang.String |
getDateFormat()
Returns the AS/400 or iSeries date format used in date literals within SQL statements. |
java.lang.String |
getDateSeparator()
Returns the AS/400 or iSeries date separator used in date literals within SQL statements. |
java.lang.String |
getDecimalSeparator()
Returns the AS/400 or iSeries decimal separator used in numeric literals within SQL statements. |
java.lang.String |
getDescription()
Returns the description of the data source. |
java.lang.String |
getDriver()
Returns the JDBC driver implementation. |
java.lang.String |
getErrors()
Returns the amount of detail for error messages originating from
the AS/400 or iSeries server. |
java.lang.String |
getLibraries()
Returns the AS/400 or iSeries libraries to add to the server job's library list. |
int |
getLobThreshold()
Returns the AS/400 or iSeries maximum LOB (large object) size in bytes that
can be retrieved as part of a result set. |
int |
getLoginTimeout()
Returns the timeout value in seconds. |
java.io.PrintWriter |
getLogWriter()
Returns the log writer for this data source. |
java.lang.String |
getNaming()
Returns the AS/400 or iSeries naming convention used when referring to tables. |
java.lang.String |
getPackage()
Returns the base name of the SQL package. |
java.lang.String |
getPackageCriteria()
Returns the type of SQL statement to be stored in the SQL package. |
java.lang.String |
getPackageError()
Returns the action to take when SQL package errors occur. |
java.lang.String |
getPackageLibrary()
Returns the library for the SQL package. |
java.lang.String |
getProxyServer()
Returns the name of the proxy server. |
javax.naming.Reference |
getReference()
Returns the Reference object for the data source object. |
java.lang.String |
getRemarks()
Returns the source of the text for REMARKS columns in ResultSets returned
by DatabaseMetaData methods. |
java.lang.String |
getSecondaryUrl()
Returns the secondary URL. |
java.lang.String |
getServerName()
Returns the name of the AS400 server property. |
int |
getServerTraceCategories()
Returns the level of tracing started on the JDBC server job. |
java.lang.String |
getSort()
Returns how the AS/400 or iSeries server sorts records before sending them to the
client. |
java.lang.String |
getSortLanguage()
Returns the three-character language id to use for selection of a sort sequence. |
java.lang.String |
getSortTable()
Returns the library and file name of a sort sequence table stored on the AS/400 or iSeries
server. |
java.lang.String |
getSortWeight()
Returns how the AS/400 or iSeries server treats case while sorting records. |
java.lang.String |
getTimeFormat()
Returns the AS/400 or iSeries time format used in time literals with SQL statements. |
java.lang.String |
getTimeSeparator()
Returns the AS/400 or iSeries time separator used in time literals within SQL
statements. |
java.lang.String |
getTransactionIsolation()
Returns the AS/400 or iSeries server's transaction isolation. |
java.lang.String |
getUser()
Returns the database user property. |
boolean |
isBigDecimal()
Indicates whether a big decimal value is returned. |
boolean |
isCursorHold()
Indicates whether the cursor is held. |
boolean |
isDataCompression()
Indicates whether data compression is used. |
boolean |
isDataTruncation()
Indicates whether data truncation is used. |
boolean |
isExtendedDynamic()
Indicates whether extended dynamic support is used. |
boolean |
isExtendedMetaData()
Indicates whether the driver should request extended metadata from the
server. |
boolean |
isFullOpen()
Indicates whether the server fully opens a file when performing a query. |
boolean |
isLazyClose()
Indicates whether to delay closing cursors until subsequent requests. |
boolean |
isPackageAdd()
Indicates whether to add newly prepared statements to the
SQL package specified on the "package" property. |
boolean |
isPackageCache()
Indicates whether a subset of the SQL package information is cached in client memory. |
boolean |
isPackageClear()
Deprecated. |
boolean |
isPrefetch()
Indicates whether data is prefetched upon executing a SELECT statement. |
boolean |
isPrompt()
Indicates whether the user is prompted if a user name or password is
needed to connect to the AS/400 or iSeries server. |
boolean |
isSavePasswordWhenSerialized()
Indicates whether the password is saved locally with the rest of
the properties when this data source object is serialized. |
boolean |
isSecure()
Indicates whether a Secure Socket Layer (SSL) connection is used to communicate
with the server. |
boolean |
isThreadUsed()
Indicates whether a thread is used. |
boolean |
isTrace()
Indicates whether trace messages should be logged. |
boolean |
isTranslateBinary()
Indicates whether binary data is translated. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener. |
void |
setAccess(java.lang.String access)
Sets the level of database access for the AS/400 or iSeries connection. |
void |
setBidiStringType(int bidiStringType)
Sets the output string type of bidi data, as defined by the CDRA (Character Data
Representation Architecture). |
void |
setBigDecimal(boolean value)
Sets whether a big decimal value is returned. |
void |
setBlockCriteria(int blockCriteria)
Sets the criteria for retrieving data from the AS/400 or iSeries server in
blocks of records. |
void |
setBlockSize(int blockSize)
Sets the block size in kilobytes to retrieve from the AS/400 or iSeries server and
cache on the client. |
void |
setCursorHold(boolean cursorHold)
Sets whether the cursor is held. |
void |
setDatabaseName(java.lang.String databaseName)
Sets the database name. |
void |
setDataCompression(boolean compression)
Sets whether to use data compression. |
void |
setDataSourceName(java.lang.String dataSourceName)
Sets the data source name. |
void |
setDataTruncation(boolean truncation)
Sets whether to use data truncation. |
void |
setDateFormat(java.lang.String dateFormat)
Sets the AS/400 or iSeries date format used in date literals within SQL statements. |
void |
setDateSeparator(java.lang.String dateSeparator)
Sets the AS/400 or iSeries date separator used in date literals within SQL statements. |
void |
setDecimalSeparator(java.lang.String decimalSeparator)
Sets the AS/400 or iSeries decimal separator used in numeric literals within SQL
statements. |
void |
setDescription(java.lang.String description)
Sets the data source description. |
void |
setDriver(java.lang.String driver)
Sets the JDBC driver implementation. |
void |
setErrors(java.lang.String errors)
Sets the amount of detail to be returned in the message for errors
occurring on the AS/400 or iSeries server. |
void |
setExtendedDynamic(boolean extendedDynamic)
Sets whether to use extended dynamic support. |
void |
setExtendedMetaData(boolean extendedMetaData)
Sets whether the driver should request extended metadata from the
server. |
void |
setFullOpen(boolean fullOpen)
Sets whether to fully open a file when performing a query. |
void |
setLazyClose(boolean lazyClose)
Sets whether to delay closing cursors until subsequent requests. |
void |
setLibraries(java.lang.String libraries)
Sets the AS/400 or iSeries libraries to add to the server job's library list. |
void |
setLobThreshold(int threshold)
Sets the AS/400 or iSeries maximum LOB (large object) size in bytes that
can be retrieved as part of a result set. |
void |
setLoginTimeout(int timeout)
Sets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
void |
setLogWriter(java.io.PrintWriter writer)
Sets the log writer for this data source. |
void |
setNaming(java.lang.String naming)
Sets the AS/400 or iSeries naming convention used when referring to tables. |
void |
setPackage(java.lang.String packageName)
Sets the base name of the SQL package. |
void |
setPackageAdd(boolean add)
Sets whether to add newly prepared statements to the SQL package
specified on the "package" property. |
void |
setPackageCache(boolean cache)
Sets whether to cache a subset of the SQL package information in client memory. |
void |
setPackageClear(boolean clear)
Deprecated. |
void |
setPackageCriteria(java.lang.String packageCriteria)
Sets the type of SQL statement to be stored in the SQL package. |
void |
setPackageError(java.lang.String packageError)
Sets the action to take when SQL package errors occur. |
void |
setPackageLibrary(java.lang.String packageLibrary)
Sets the library for the SQL package. |
void |
setPassword(java.lang.String password)
Sets the database password. |
void |
setPrefetch(boolean prefetch)
Sets whether to prefetch data upon executing a SELECT statement. |
void |
setPrompt(boolean prompt)
Sets whether the user should be prompted if a user name or password is
needed to connect to the AS/400 or iSeries server. |
void |
setProxyServer(java.lang.String proxyServer)
Sets the name of the proxy server. |
void |
setRemarks(java.lang.String remarks)
Sets the source of the text for REMARKS columns in ResultSets returned
by DatabaseMetaData methods. |
void |
setSavePasswordWhenSerialized(boolean savePassword)
Sets whether to save the password locally with the rest of the properties when
this data source object is serialized. |
void |
setSecondaryUrl(java.lang.String url)
Sets the secondary URL to be used for a connection on the middle-tier's
DriverManager in a multiple tier environment, if it is different than
already specified. |
void |
setSecure(boolean secure)
Sets whether a Secure Socket Layer (SSL) connection is used to communicate
with the server. |
void |
setServerName(java.lang.String serverName)
Sets the AS/400 or iSeries server name. |
void |
setServerTraceCategories(int traceCategories)
Enables tracing of the JDBC server job. |
void |
setSort(java.lang.String sort)
Sets how the AS/400 or iSeries server sorts records before sending them to the client. |
void |
setSortLanguage(java.lang.String language)
Sets the three-character language id to use for selection of a sort sequence. |
void |
setSortTable(java.lang.String table)
Sets the library and file name of a sort sequence table stored on the AS/400 or iSeries
server. |
void |
setSortWeight(java.lang.String sortWeight)
Sets how the AS/400 or iSeries server treats case while sorting records. |
void |
setThreadUsed(boolean threadUsed)
Sets whether a thread is used. |
void |
setTimeFormat(java.lang.String timeFormat)
Sets the AS/400 or iSeries time format used in time literals with SQL statements. |
void |
setTimeSeparator(java.lang.String timeSeparator)
Sets the AS/400 or iSeries time separator used in time literals within SQL statements. |
void |
setTrace(boolean trace)
Sets whether trace messages should be logged. |
void |
setTransactionIsolation(java.lang.String transactionIsolation)
Sets the AS/400 or iSeries server's transaction isolation. |
void |
setTranslateBinary(boolean translate)
Sets whether binary data is translated. |
void |
setUser(java.lang.String user)
Sets the database user. |
java.lang.String |
toString()
Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SERVER_TRACE_START_DATABASE_MONITOR
public static final int SERVER_TRACE_START_DATABASE_MONITOR
- Start the database monitor on the JDBC server job.
This constant is used when setting the level of tracing for the JDBC server job.
The numeric value of this constant is 2.
SERVER_TRACE_DEBUG_SERVER_JOB
public static final int SERVER_TRACE_DEBUG_SERVER_JOB
- Start debug on the JDBC server job.
This constant is used when setting the level of tracing for the JDBC server job.
The numeric value of this constant is 4.
SERVER_TRACE_SAVE_SERVER_JOBLOG
public static final int SERVER_TRACE_SAVE_SERVER_JOBLOG
- Save the joblog when the JDBC server job ends.
This constant is used when setting the level of tracing for the JDBC server job.
The numeric value of this constant is 8.
SERVER_TRACE_TRACE_SERVER_JOB
public static final int SERVER_TRACE_TRACE_SERVER_JOB
- Start job trace on the JDBC server job.
This constant is used when setting the level of tracing for the JDBC server job.
The numeric value of this constant is 16.
SERVER_TRACE_SAVE_SQL_INFORMATION
public static final int SERVER_TRACE_SAVE_SQL_INFORMATION
- Save SQL information.
This constant is used when setting the level of tracing for the JDBC server job.
The numeric value of this constant is 32.
AS400JDBCDataSource
public AS400JDBCDataSource()
- Constructs a default AS40JDBCDataSource object.
AS400JDBCDataSource
public AS400JDBCDataSource(java.lang.String serverName)
- Constructs an AS400JDBCDataSource object to the specified serverName.
- Parameters:
serverName
- The name of the AS/400 or iSeries server.
AS400JDBCDataSource
public AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password)
- Constructs an AS400JDBCDataSource object with the specified signon information.
- Parameters:
serverName
- The name of the AS/400 or iSeries server.user
- The user id.password
- The user password.
AS400JDBCDataSource
public AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password,
java.lang.String keyRingName,
java.lang.String keyRingPassword)
- Constructs an AS400JDBCDataSource object with the specified signon information
to use for SSL communications with the server.
- Parameters:
serverName
- The name of the AS/400 or iSeries server.user
- The user id.password
- The user password.keyRingName
- The key ring class name to be used for SSL communications with the server.keyRingPassword
- The password for the key ring class to be used for SSL communications with the server.
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Adds a PropertyChangeListener. The specified PropertyChangeListener's
propertyChange method is called each time the value of any bound
property is changed.
- Parameters:
listener
- The PropertyChangeListener.- See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)
getAccess
public java.lang.String getAccess()
- Returns the level of database access for the AS/400 or iSeries connection.
- Returns:
- The access level. Valid values include: "all" (all SQL statements allowed),
"read call" (SELECT and CALL statements allowed), and "read only" (SELECT statements only).
The default value is "all".
getBidiStringType
public int getBidiStringType()
- Returns the output string type of bidi data, as defined by the CDRA
(Character Data Representation Architecture). See
BidiStringType for more information and valid values. -1 will be returned
if the value has not been set.
getBlockCriteria
public int getBlockCriteria()
- Returns the criteria for retrieving data from the AS/400 or iSeries server in
blocks of records. Specifying a non-zero value for this property
will reduce the frequency of communication to the server, and
therefore increase performance.
- Returns:
- The block criteria.
Valid values include:
- 0 (no record blocking)
- 1 (block if FOR FETCH ONLY is specified)
- 2 (block if FOR UPDATE is specified) - The default value.
getBlockSize
public int getBlockSize()
- Returns the block size in kilobytes to retrieve from the AS/400 or iSeries server and
cache on the client. This property has no effect unless the block criteria
property is non-zero. Larger block sizes reduce the frequency of
communication to the server, and therefore may increase performance.
- Returns:
- The block size in kilobytes.
Valid values include:
- 0
- 8
- 16
- 32 - The default value.
- 64
- 128
- 256
- 512
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Returns the database connection.
- Specified by:
getConnection
in interface javax.sql.DataSource
- Returns:
- The connection.
- Throws:
java.sql.SQLException
- If a database error occurs.
getConnection
public java.sql.Connection getConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
- Returns the database connection using the specified user and password.
- Specified by:
getConnection
in interface javax.sql.DataSource
- Parameters:
user
- The database user.password
- The database password.- Returns:
- The connection
- Throws:
java.sql.SQLException
- If a database error occurs.
getDatabaseName
public java.lang.String getDatabaseName()
- Returns the database name property. For more information see
the documention for the setDatabaseName() method in this class.
- Returns:
- The database name.
getDataSourceName
public java.lang.String getDataSourceName()
- Returns the data source name property.
This property is used to name an underlying data source when connection pooling is used.
- Returns:
- The data source name.
getDateFormat
public java.lang.String getDateFormat()
- Returns the AS/400 or iSeries date format used in date literals within SQL statements.
- Returns:
- The date format.
Valid values include:
- "mdy"
- "dmy"
- "ymd"
- "usa"
- "iso"
- "eur"
- "jis"
- "julian"
- "" (server job value) - default.
The default is based on the server job.
getDateSeparator
public java.lang.String getDateSeparator()
- Returns the AS/400 or iSeries date separator used in date literals within SQL statements.
This property has no effect unless the "data format" property is set to:
"julian", "mdy", "dmy", or "ymd".
- Returns:
- The date separator.
Valid values include:
- "/" (slash)
- "-" (dash)
- "." (period)
- "," (comma)
- " " (space)
- "" (server job value) - default.
The default value is based on the server job.
getDecimalSeparator
public java.lang.String getDecimalSeparator()
- Returns the AS/400 or iSeries decimal separator used in numeric literals within SQL statements.
- Returns:
- The decimal separator.
Valid values include:
- "." (period)
- "," (comma)
- "" (server job value) - default.
The default value is based on the server job.
getDescription
public java.lang.String getDescription()
- Returns the description of the data source.
- Returns:
- The description.
getDriver
public java.lang.String getDriver()
- Returns the JDBC driver implementation.
This property has no
effect if the "secondary URL" property is set.
This property cannot be set to "native" if the
environment is not an AS/400 or iSeries Java Virtual
Machine.
Valid values include:
- "default" (base the implementation on the environment)
- "toolbox" (use the IBM Toolbox for Java JDBC driver)
- "native" (use the IBM Developer Kit for Java JDBC driver)
The default value is "default".
getErrors
public java.lang.String getErrors()
- Returns the amount of detail for error messages originating from
the AS/400 or iSeries server.
- Returns:
- The error message level.
Valid values include: "basic" and "full". The default value is "basic".
getLibraries
public java.lang.String getLibraries()
- Returns the AS/400 or iSeries libraries to add to the server job's library list.
The libraries are delimited by commas or spaces, and
"*LIBL" may be used as a place holder for the server job's
current library list. The library list is used for resolving
unqualified stored procedure calls and finding schemas in
DatabaseMetaData catalog methods. If "*LIBL" is not specified,
the specified libraries will replace the server job's current library list.
- Returns:
- The library list.
getLobThreshold
public int getLobThreshold()
- Returns the AS/400 or iSeries maximum LOB (large object) size in bytes that
can be retrieved as part of a result set. LOBs that are larger
than this threshold will be retrieved in pieces using extra
communication to the server. Larger LOB thresholds will reduce
the frequency of communication to the server, but will download
more LOB data, even if it is not used. Smaller LOB thresholds may
increase frequency of communication to the server, but will only
download LOB data as it is needed.
- Returns:
- The lob threshold. Valid range is 0-16777216.
The default value is 0.
getLoginTimeout
public int getLoginTimeout()
- Returns the timeout value in seconds.
Note: This value is not used or supported.
The timeout value is determined by the AS/400 or iSeries.
- Specified by:
getLoginTimeout
in interface javax.sql.DataSource
- Returns:
- Always returns 0.
getLogWriter
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
- Returns the log writer for this data source.
- Specified by:
getLogWriter
in interface javax.sql.DataSource
- Returns:
- The log writer for this data source.
- Throws:
java.sql.SQLException
- If a database error occurs.
getNaming
public java.lang.String getNaming()
- Returns the AS/400 or iSeries naming convention used when referring to tables.
- Returns:
- The naming convention. Valid values include: "sql" (e.g. schema.table)
and "system" (e.g. schema/table). The default value is "sql".
getPackage
public java.lang.String getPackage()
- Returns the base name of the SQL package. Note that only the
first seven characters are used to generate the name of the SQL package on the server.
This property has no effect unless
the extended dynamic property is set to true. In addition, this property
must be set if the extended dynamic property is set to true.
- Returns:
- The base name of the SQL package.
getPackageCriteria
public java.lang.String getPackageCriteria()
- Returns the type of SQL statement to be stored in the SQL package. This can
be useful to improve the performance of complex join conditions. This
property has no effect unless the extended dynamic property is set to true.
- Returns:
- The type of SQL statement.
Valid values include: "default" (only store SQL statements with parameter
markers in the package) and "select" (store all SQL SELECT statements
in the package). The default value is "default".
getPackageError
public java.lang.String getPackageError()
- Returns the action to take when SQL package errors occur. When an SQL package
error occurs, the driver will optionally throw an SQLException or post a
warning to the Connection, based on the value of this property. This property
has no effect unless the extended dynamic property is set to true.
- Returns:
- The action to take when SQL errors occur.
Valid values include: "exception", "warning", and "none". The default value is "warning".
getPackageLibrary
public java.lang.String getPackageLibrary()
- Returns the library for the SQL package. This property has no effect unless
the extended dynamic property is set to true.
- Returns:
- The SQL package library. The default library is "QGPL".
getProxyServer
public java.lang.String getProxyServer()
- Returns the name of the proxy server.
- Returns:
- The proxy server.
getReference
public javax.naming.Reference getReference()
throws javax.naming.NamingException
- Returns the Reference object for the data source object.
This is used by JNDI when bound in a JNDI naming service.
Contains the information necessary to reconstruct the data source
object when it is later retrieved from JNDI via an object factory.
- Specified by:
getReference
in interface javax.naming.Referenceable
- Returns:
- A Reference object of the data source object.
- Throws:
javax.naming.NamingException
- If a naming error occurs in resolving the object.
getRemarks
public java.lang.String getRemarks()
- Returns the source of the text for REMARKS columns in ResultSets returned
by DatabaseMetaData methods.
- Returns:
- The text source.
Valid values include: "sql" (SQL object comment) and "system" (OS/400 object description).
The default value is "system".
getSecondaryUrl
public java.lang.String getSecondaryUrl()
- Returns the secondary URL.
- Returns:
- The secondary URL.
getServerName
public java.lang.String getServerName()
- Returns the name of the AS400 server property.
- Returns:
- The server name.
getServerTraceCategories
public int getServerTraceCategories()
- Returns the level of tracing started on the JDBC server job.
If tracing is enabled, tracing is started when
the client connects to the server and ends when the connection
is disconnected. Tracing must be started before connecting to
the server since the client enables server tracing only at connect time.
Trace data is collected in spooled files on the server. Multiple
levels of server tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
dataSource.setServerTraceCategories(AS400JDBCDataSource.SERVER_TRACE_START_DATABASE_MONITOR + AS400JDBCDataSource.SERVER_TRACE_SAVE_SERVER_JOBLOG);
- Returns:
- The server tracing level.
The value is a combination of the following:
- SERVER_TRACE_START_DATABASE_MONITOR - Start the database monitor on the JDBC server job.
The numeric value of this constant is 2.
- SERVER_TRACE_DEBUG_SERVER_JOB - Start debug on the JDBC server job.
The numeric value of this constant is 4.
- SERVER_TRACE_SAVE_SERVER_JOBLOG - Save the joblog when the JDBC server job ends.
The numeric value of this constant is 8.
- SERVER_TRACE_TRACE_SERVER_JOB - Start job trace on the JDBC server job.
The numeric value of this constant is 16.
- SERVER_TRACE_SAVE_SQL_INFORMATION - Save SQL information.
The numeric value of this constant is 32.
Tracing the JDBC server job will use significant amounts of server resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on server tracing only to debug
a problem as directed by IBM service.
getSort
public java.lang.String getSort()
- Returns how the AS/400 or iSeries server sorts records before sending them to the
client.
- Returns:
- The sort value.
Valid values include:
- "hex" (base the sort on hexadecimal values)
- "job" (base the sort on the setting for the server job)
- "language" (base the sort on the language set in the sort language property)
- "table" (base the sort on the sort sequence table set in the sort table property)
The default value is "job".
getSortLanguage
public java.lang.String getSortLanguage()
- Returns the three-character language id to use for selection of a sort sequence.
- Returns:
- The three-character language id.
The default value is based on the locale.
getSortTable
public java.lang.String getSortTable()
- Returns the library and file name of a sort sequence table stored on the AS/400 or iSeries
server.
- Returns:
- The qualified sort table name.
getSortWeight
public java.lang.String getSortWeight()
- Returns how the AS/400 or iSeries server treats case while sorting records.
- Returns:
- The sort weight.
Valid values include: "shared" (upper- and lower-case characters are sorted as the
same character) and "unique" (upper- and lower-case characters are sorted as
different characters). The default value is "shared".
getTimeFormat
public java.lang.String getTimeFormat()
- Returns the AS/400 or iSeries time format used in time literals with SQL statements.
- Returns:
- The time format.
Valid values include:
- "hms"
- "usa"
- "iso"
- "eur"
- "jis"
- "" (server job value) - default.
The default value is based on the server job.
getTimeSeparator
public java.lang.String getTimeSeparator()
- Returns the AS/400 or iSeries time separator used in time literals within SQL
statements.
- Returns:
- The time separator.
Valid values include:
- ":" (colon)
- "." (period)
- "," (comma)
- " " (space)
- "" (server job value) - default.
The default value is based on the server job.
getTransactionIsolation
public java.lang.String getTransactionIsolation()
- Returns the AS/400 or iSeries server's transaction isolation.
- Returns:
- The transaction isolation level.
Valid values include:
- "none"
- "read uncommitted" - The default value.
- "read committed"
- "repeatable read"
- "serializable"
getUser
public java.lang.String getUser()
- Returns the database user property.
- Returns:
- The user.
isBigDecimal
public boolean isBigDecimal()
- Indicates whether a big decimal value is returned.
- Returns:
- true if a big decimal is returned; false otherwise.
The default value is true.
isCursorHold
public boolean isCursorHold()
- Indicates whether the cursor is held.
- Returns:
- true if the cursor is held; false otherwise.
The default value is true.
isDataCompression
public boolean isDataCompression()
- Indicates whether data compression is used.
- Returns:
- true if data compression is used; false otherwise.
The default value is true.
isDataTruncation
public boolean isDataTruncation()
- Indicates whether data truncation is used.
- Returns:
- true if data truncation is used; false otherwise.
The default value is true.
isExtendedDynamic
public boolean isExtendedDynamic()
- Indicates whether extended dynamic support is used. Extended dynamic
support provides a mechanism for caching dynamic SQL statements on
the server. The first time a particular SQL statement is prepared, it is
stored in an SQL package on the server.
If the package does not exist, it will be automatically created.
On subsequent prepares of the
same SQL statement, the server can skip a significant part of the
processing by using information stored in the SQL package.
- Returns:
- true if extended dynamic support is used; false otherwise.
The default value is not to use extended dynamic support.
isExtendedMetaData
public boolean isExtendedMetaData()
- Indicates whether the driver should request extended metadata from the
server. If this property is set to true, the accuracy of the information
that is returned from ResultSetMetaData methods getColumnLabel(int),
isReadOnly(int), isSearchable(int), and isWriteable(int) will be increased.
In addition, the ResultSetMetaData method getSchemaName(int) will be supported with this
property set to true. However, performance will be slower with this
property on. Leave this property set to its default (false) unless you
need more specific information from those methods.
For example, without this property turned on, isSearchable(int) will
always return true even though the correct answer may be false because
the driver does not have enough information from the server to make a judgment. Setting
this property to true forces the driver to get the correct data from the server.
- Returns:
- true if extended metadata will be requested; false otherwise.
The default value is false.
isFullOpen
public boolean isFullOpen()
- Indicates whether the server fully opens a file when performing a query.
By default the server optimizes opens so they perform better. In
certain cases an optimized open will fail. In some
cases a query will fail when a database performance monitor
is turned on even though the same query works with the monitor
turned off. In this case set the full open property to true.
This disables optimization on the server.
- Returns:
- true if files are fully opened; false otherwise.
The default value is false.
isLazyClose
public boolean isLazyClose()
- Indicates whether to delay closing cursors until subsequent requests.
- Returns:
- true to delay closing cursors until subsequent requests; false otherwise.
The default value is false.
isPackageAdd
public boolean isPackageAdd()
- Indicates whether to add newly prepared statements to the
SQL package specified on the "package" property. This property
has no effect unless the extended dynamic property is set to true;
- Returns:
- true If newly prepared statements should be added to the SQL package specified
on the "package" property; false otherwise.
The default value is true.
isPackageCache
public boolean isPackageCache()
- Indicates whether a subset of the SQL package information is cached in client memory.
Caching SQL packages locally
reduces the amount of communication to the server for prepares and describes. This
property has no effect unless the extended dynamic property is set to true.
- Returns:
- true if caching is used; false otherwise.
The defalut value is false.
isPackageClear
public boolean isPackageClear()
- Deprecated.
- Indicates whether SQL packages are cleared when they become full. This method
has been deprecated. Package clearing and the decision for the
threshold where package clearing is needed is now handled
automatically by the database.
- Returns:
- Always false. This method is deprecated.
isPrefetch
public boolean isPrefetch()
- Indicates whether data is prefetched upon executing a SELECT statement.
This will increase performance when accessing the initial rows in the result set.
- Returns:
- If prefetch is used; false otherwise.
The default value is prefetch data.
isPrompt
public boolean isPrompt()
- Indicates whether the user is prompted if a user name or password is
needed to connect to the AS/400 or iSeries server. If a connection can not be made
without prompting the user, and this property is set to false, then an
attempt to connect will fail throwing an exception.
- Returns:
- true if the user is prompted for signon information; false otherwise.
The default value is false.
isSavePasswordWhenSerialized
public boolean isSavePasswordWhenSerialized()
- Indicates whether the password is saved locally with the rest of
the properties when this data source object is serialized.
If the password is saved, it is up to the application to protect
the serialized form of the object because it contains all necessary
information to connect to the server. The default is false. It
is a security risk to save the password with the rest of the
properties so by default the password is not saved. If the programmer
chooses to accept this risk, call setSavePasswordWhenSerialized(true)
to force the Toolbox to save the password with the other properties
when the data source object is serialized.
- Returns:
- true if the password is saved with the rest of the properties when the
data source object is serialized; false otherwise.
The default value is false.
isSecure
public boolean isSecure()
- Indicates whether a Secure Socket Layer (SSL) connection is used to communicate
with the server. SSL connections are only available when connecting to servers
at V4R4 or later.
- Returns:
- true if Secure Socket Layer connection is used; false otherwise.
The default value is false.
isThreadUsed
public boolean isThreadUsed()
- Indicates whether a thread is used.
- Returns:
- true if a thread is used; false otherwise.
The default value is true.
isTrace
public boolean isTrace()
- Indicates whether trace messages should be logged.
- Returns:
- true if trace message are logged; false otherwise.
The default value is false.
isTranslateBinary
public boolean isTranslateBinary()
- Indicates whether binary data is translated. If this property is set
to true, then BINARY and VARBINARY fields are treated as CHAR and
VARCHAR fields.
- Returns:
- true if binary data is translated; false otherwise.
The default value is false.
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Removes the PropertyChangeListener.
If the PropertyChangeListener is not in the list, nothing is done.
- Parameters:
listener
- The PropertyChangeListener.- See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)
setAccess
public void setAccess(java.lang.String access)
- Sets the level of database access for the AS/400 or iSeries connection.
- Parameters:
access
- The access level.
Valid values include:
- "all" (all SQL statements allowed)
- "read call" (SELECT and CALL statements allowed)
- "read only" (SELECT statements only)
The default value is "all".
setBidiStringType
public void setBidiStringType(int bidiStringType)
- Sets the output string type of bidi data, as defined by the CDRA (Character Data
Representation Architecture). See
BidiStringType for more information and valid values.
setBigDecimal
public void setBigDecimal(boolean value)
- Sets whether a big decimal value is returned.
- Parameters:
value
- true if a big decimal is returned; false otherwise.
The default value is true.
setBlockCriteria
public void setBlockCriteria(int blockCriteria)
- Sets the criteria for retrieving data from the AS/400 or iSeries server in
blocks of records. Specifying a non-zero value for this property
will reduce the frequency of communication to the server, and
therefore increase performance.
- Parameters:
blockCriteria
- The block criteria.
Valid values include:
- 0 (no record blocking)
- 1 (block if FOR FETCH ONLY is specified)
- 2 (block if FOR UPDATE is specified) - The default value.
setBlockSize
public void setBlockSize(int blockSize)
- Sets the block size in kilobytes to retrieve from the AS/400 or iSeries server and
cache on the client. This property has no effect unless the block criteria
property is non-zero. Larger block sizes reduce the frequency of
communication to the server, and therefore may increase performance.
- Parameters:
blockSize
- The block size in kilobytes.
Valid values include:
- 0
- 8
- 16
- 32 - The default value.
- 64
- 128
- 256
- 512
setCursorHold
public void setCursorHold(boolean cursorHold)
- Sets whether the cursor is held.
- Parameters:
cursorHold
- true if the cursor is held; false otherwise. The default value is true.
setDatabaseName
public void setDatabaseName(java.lang.String databaseName)
- Sets the database name.
This property is ignored when connecting to systems
running V5R1 and earlier versions of OS/400.
If a database name is specified it must exist in the relational
database directory on the server. Use OS/400 command WRKRDBDIRE
to view the directory.
The following criteria are used to determine
which database is accessed:
- If a database name is specified, that database is used. Attempts
to connect will fail if the database does not exist.
- If special value *SYSBAS is specified, the system default database is used.
- If a database name is not specified, the database specified
in the job description for the user profile is used.
- If a database name is not specified and a database is not specified
in the job description for the user profile, the system default
database is used.
- Parameters:
databaseName
- The database name or *SYSBAS.
setDataCompression
public void setDataCompression(boolean compression)
- Sets whether to use data compression. The default value is true.
- Parameters:
compression
- true if data compression is used; false otherwise.
setDataSourceName
public void setDataSourceName(java.lang.String dataSourceName)
- Sets the data source name.
This property can be used for connection pooling implementations.
- Parameters:
dataSourceName
- The data source name.
setDataTruncation
public void setDataTruncation(boolean truncation)
- Sets whether to use data truncation. The default value is true.
- Parameters:
truncation
- true if data truncation is used; false otherwise.
setDateFormat
public void setDateFormat(java.lang.String dateFormat)
- Sets the AS/400 or iSeries date format used in date literals within SQL statements.
- Parameters:
dateFormat
- The date format.
Valid values include:
- "mdy"
- "dmy"
- "ymd"
- "usa"
- "iso"
- "eur"
- "jis"
- "julian"
- "" (server job value) - default.
The default is based on the server job.
setDateSeparator
public void setDateSeparator(java.lang.String dateSeparator)
- Sets the AS/400 or iSeries date separator used in date literals within SQL statements.
This property has no effect unless the "data format" property is set to:
"julian", "mdy", "dmy", or "ymd".
- Parameters:
dateSeparator
- The date separator.
Valid values include:
- "/" (slash)
- "-" (dash)
- "." (period)
- "," (comma)
- " " (space)
- "" (server job value) - default.
The default value is based on the server job.
setDecimalSeparator
public void setDecimalSeparator(java.lang.String decimalSeparator)
- Sets the AS/400 or iSeries decimal separator used in numeric literals within SQL
statements.
- Parameters:
decimalSeparator
- The decimal separator.
Valid values include:
- "." (period)
- "," (comma)
- "" (server job value) - default.
The default value is based on the server job.
setDescription
public void setDescription(java.lang.String description)
- Sets the data source description.
- Parameters:
description
- The description.
setSort
public void setSort(java.lang.String sort)
- Sets how the AS/400 or iSeries server sorts records before sending them to the client.
- Parameters:
sort
- The sort value.
Valid values include:
- "hex" (base the sort on hexadecimal values)
- "job" (base the sort on the setting for the server job)
- "language" (base the sort on the language set in the sort language property)
- "table" (base the sort on the sort sequence table set in the sort table property).
The default value is "job".
setErrors
public void setErrors(java.lang.String errors)
- Sets the amount of detail to be returned in the message for errors
occurring on the AS/400 or iSeries server.
- Parameters:
errors
- The error message level.
Valid values include: "basic" and "full". The default value is "basic".
setExtendedDynamic
public void setExtendedDynamic(boolean extendedDynamic)
- Sets whether to use extended dynamic support. Extended dynamic
support provides a mechanism for caching dynamic SQL statements on
the server. The first time a particular SQL statement is prepared, it is
stored in an SQL package on the server.
If the package does not exist, it will be automatically created.
On subsequent prepares of the
same SQL statement, the server can skip a significant part of the
processing by using information stored in the SQL package. If this
is set to "true", then a package name must be set using the "package"
property.
- Parameters:
extendedDynamic
- If extended dynamic support is used; false otherwise.
The default value is not to use extended dynamic support.
setExtendedMetaData
public void setExtendedMetaData(boolean extendedMetaData)
- Sets whether the driver should request extended metadata from the
server. This property is ignored when connecting to systems
running V5R1 and earlier versions of OS/400.
If this property is set to true and connecting to a system running
V5R2 or later version of OS/400, the accuracy of the information
that is returned from ResultSetMetaData methods getColumnLabel(int),
isReadOnly(int), isSearchable(int), and isWriteable(int) will be increased.
In addition, the ResultSetMetaData method getSchemaName(int) will be supported with this
property set to true. However, performance will be slower with this
property on. Leave this property set to its default (false) unless you
need more specific information from those methods.
For example, without this property turned on, isSearchable(int) will
always return true even though the correct answer may be false because
the driver does not have enough information from the server to make a judgment. Setting
this property to true forces the driver to get the correct data from the server.
- Parameters:
extendedMetaData
- True to request extended metadata from the server, false otherwise.
The default value is false.
setFullOpen
public void setFullOpen(boolean fullOpen)
- Sets whether to fully open a file when performing a query.
By default the server optimizes opens so they perform better.
In most cases optimization functions correctly and improves
performance. Running a query repeatedly
when a database performance monitor is turned on may fail
because of the optimization, however.
Leave this property set to its default (false) until
you experience errors running queries with monitors
turned on. At that time set the property to true which
will disable the optimization.
- Parameters:
fullOpen
- True to fully open a file (turn off optimizations), false
to allow optimizations. The default value is false.
setLazyClose
public void setLazyClose(boolean lazyClose)
- Sets whether to delay closing cursors until subsequent requests.
- Parameters:
lazyClose
- true to delay closing cursors until subsequent requests; false otherwise.
The default value is false.
setLibraries
public void setLibraries(java.lang.String libraries)
- Sets the AS/400 or iSeries libraries to add to the server job's library list.
The libraries are delimited by commas or spaces, and
"*LIBL" may be used as a place holder for the server job's
current library list. The library list is used for resolving
unqualified stored procedure calls and finding schemas in
DatabaseMetaData catalog methods. If "*LIBL" is not specified,
the specified libraries will replace the server job's
current library list.
- Parameters:
libraries
- The library list.
setLobThreshold
public void setLobThreshold(int threshold)
- Sets the AS/400 or iSeries maximum LOB (large object) size in bytes that
can be retrieved as part of a result set. LOBs that are larger
than this threshold will be retrieved in pieces using extra
communication to the server. Larger LOB thresholds will reduce
the frequency of communication to the server, but will download
more LOB data, even if it is not used. Smaller LOB thresholds may
increase frequency of communication to the server, but will only
download LOB data as it is needed.
- Parameters:
threshold
- The lob threshold. Valid range is 0-16777216.
The default value is 0.
setLoginTimeout
public void setLoginTimeout(int timeout)
throws java.sql.SQLException
- Sets the maximum time in seconds that this data source can wait while attempting to connect to a database.
A value of zero specifies that the timeout is the system default if one exists; otherwise it specifies that
there is no timeout. The default value is initially zero.
Note: This value is not used or supported.
- Specified by:
setLoginTimeout
in interface javax.sql.DataSource
- Parameters:
timeout
- The login timeout in seconds.- Throws:
java.sql.SQLException
- The timeout parameter is not supported.
setLogWriter
public void setLogWriter(java.io.PrintWriter writer)
throws java.sql.SQLException
- Sets the log writer for this data source.
- Specified by:
setLogWriter
in interface javax.sql.DataSource
- Parameters:
writer
- The log writer; to disable, set to null.- Throws:
java.sql.SQLException
- If a database error occurs.
setNaming
public void setNaming(java.lang.String naming)
- Sets the AS/400 or iSeries naming convention used when referring to tables.
- Parameters:
naming
- The naming convention. Valid values include: "sql" (e.g. schema.table)
and "system" (e.g. schema/table). The default value is "sql".
setPackage
public void setPackage(java.lang.String packageName)
- Sets the base name of the SQL package. Note that only the
first seven characters are used to generate the name of the SQL package on the server.
This property has no effect unless
the extended dynamic property is set to true. In addition, this property
must be set if the extended dynamic property is set to true.
- Parameters:
packageName
- The base name of the SQL package.
setPackageAdd
public void setPackageAdd(boolean add)
- Sets whether to add newly prepared statements to the SQL package
specified on the "package" property. This property
has no effect unless the extended dynamic property is set to true.
- Parameters:
add
- If newly prepared statements should be added to the SQL package specified on
the "package" property; false otherwise.
The default value is true.
setPackageCache
public void setPackageCache(boolean cache)
- Sets whether to cache a subset of the SQL package information in client memory.
Caching SQL packages locally
reduces the amount of communication to the server for prepares and describes. This
property has no effect unless the extended dynamic property is set to true.
- Parameters:
cache
- If caching is used; false otherwise. The default value is false.
setPackageClear
public void setPackageClear(boolean clear)
- Deprecated.
- Sets whether to clear SQL packages when they become full. This method
has been deprecated. Package clearing and the decision for the
threshold where package clearing is needed is now handled
automatically by the database.
- Parameters:
clear
- If the SQL package are cleared when full; false otherwise.
setPackageCriteria
public void setPackageCriteria(java.lang.String packageCriteria)
- Sets the type of SQL statement to be stored in the SQL package. This can
be useful to improve the performance of complex join conditions. This
property has no effect unless the extended dynamic property is set to true.
- Parameters:
packageCriteria
- The type of SQL statement.
Valid values include: "default" (only store SQL statements with parameter
markers in the package), and "select" (store all SQL SELECT statements
in the package). The default value is "default".
setPackageError
public void setPackageError(java.lang.String packageError)
- Sets the action to take when SQL package errors occur. When an SQL package
error occurs, the driver will optionally throw an SQLException or post a
warning to the Connection, based on the value of this property. This property
has no effect unless the extended dynamic property is set to true.
- Parameters:
packageError
- The action when SQL errors occur.
Valid values include: "exception", "warning", and "none". The default value is "warning".
setPackageLibrary
public void setPackageLibrary(java.lang.String packageLibrary)
- Sets the library for the SQL package. This property has no effect unless
the extended dynamic property is set to true.
- Parameters:
packageLibrary
- The SQL package library. The default library is "QGPL".
setPassword
public void setPassword(java.lang.String password)
- Sets the database password.
- Parameters:
password
- The password.
setPrefetch
public void setPrefetch(boolean prefetch)
- Sets whether to prefetch data upon executing a SELECT statement.
This will increase performance when accessing the initial rows in the result set.
- Parameters:
prefetch
- If prefetch is used; false otherwise.
The default value is to prefectch data.
setPrompt
public void setPrompt(boolean prompt)
- Sets whether the user should be prompted if a user name or password is
needed to connect to the AS/400 or iSeries server. If a connection can not be made
without prompting the user, and this property is set to false, then an
attempt to connect will fail.
- Parameters:
prompt
- true if the user is prompted for signon information; false otherwise.
The default value is false.
setProxyServer
public void setProxyServer(java.lang.String proxyServer)
- Sets the name of the proxy server.
- Parameters:
proxyServer
- The proxy server.
setRemarks
public void setRemarks(java.lang.String remarks)
- Sets the source of the text for REMARKS columns in ResultSets returned
by DatabaseMetaData methods.
- Parameters:
remarks
- The text source.
Valid values include: "sql" (SQL object comment) and "system" (OS/400 object description).
The default value is "system".
setSecondaryUrl
public void setSecondaryUrl(java.lang.String url)
- Sets the secondary URL to be used for a connection on the middle-tier's
DriverManager in a multiple tier environment, if it is different than
already specified. This property allows you to use this driver to connect
to databases other than the AS/400 or iSeries. Use a backslash as an escape character
before backslashes and semicolons in the URL.
- Parameters:
url
- The secondary URL.
setSecure
public void setSecure(boolean secure)
- Sets whether a Secure Socket Layer (SSL) connection is used to communicate
with the server. SSL connections are only available when connecting to servers
at V4R4 or later.
- Parameters:
secure
- true if Secure Socket Layer connection is used; false otherwise.
The default value is false.
setServerName
public void setServerName(java.lang.String serverName)
- Sets the AS/400 or iSeries server name.
- Parameters:
serverName
- The server name.
setServerTraceCategories
public void setServerTraceCategories(int traceCategories)
- Enables tracing of the JDBC server job.
If tracing is enabled, tracing is started when
the client connects to the server, and ends when the connection
is disconnected. Tracing must be started before connecting to
the server since the client enables server tracing only at connect time.
Trace data is collected in spooled files on the server. Multiple
levels of server tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
dataSource.setServerTraceCategories(AS400JDBCDataSource.SERVER_TRACE_START_DATABASE_MONITOR + AS400JDBCDataSource.SERVER_TRACE_SAVE_SERVER_JOBLOG);
- Parameters:
traceCategories
- level of tracing to start.
Valid values include:
- SERVER_TRACE_START_DATABASE_MONITOR - Start the database monitor on the JDBC server job.
The numeric value of this constant is 2.
- SERVER_TRACE_DEBUG_SERVER_JOB - Start debug on the JDBC server job.
The numeric value of this constant is 4.
- SERVER_TRACE_SAVE_SERVER_JOBLOG - Save the joblog when the JDBC server job ends.
The numeric value of this constant is 8.
- SERVER_TRACE_TRACE_SERVER_JOB - Start job trace on the JDBC server job.
The numeric value of this constant is 16.
- SERVER_TRACE_SAVE_SQL_INFORMATION - Save SQL information.
The numeric value of this constant is 32.
Tracing the JDBC server job will use significant amounts of server resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on server tracing only to debug
a problem as directed by IBM service.
setDriver
public void setDriver(java.lang.String driver)
- Sets the JDBC driver implementation.
This property has no
effect if the "secondary URL" property is set.
This property cannot be set to "native" if the
environment is not an AS/400 or iSeries Java Virtual
Machine.
param driver The driver value.
Valid values include:
- "default" (base the implementation on the environment)
- "toolbox" (use the IBM Toolbox for Java JDBC driver)
- "native" (use the IBM Developer Kit for Java JDBC driver)
The default value is "default".
setSavePasswordWhenSerialized
public void setSavePasswordWhenSerialized(boolean savePassword)
- Sets whether to save the password locally with the rest of the properties when
this data source object is serialized.
If the password is saved, it is up to the application to protect
the serialized form of the object because it contains all necessary
information to connect to the server. The default is false. It
is a security risk to save the password with the rest of the
properties so by default the password is not saved. If the application
programmer chooses to accept this risk, set this property to true
to force the Toolbox to save the password with the other properties
when the data source object is serialized.
- Parameters:
savePassword
- true if the password is saved; false otherwise.
The default value is false
setSortLanguage
public void setSortLanguage(java.lang.String language)
- Sets the three-character language id to use for selection of a sort sequence.
This property has no effect unless the sort property is set to "language".
- Parameters:
language
- The three-character language id.
The default value is based on the locale.
setSortTable
public void setSortTable(java.lang.String table)
- Sets the library and file name of a sort sequence table stored on the AS/400 or iSeries
server.
This property has no effect unless the sort property is set to "table".
The default is an empty String ("").
- Parameters:
table
- The qualified sort table name.
setSortWeight
public void setSortWeight(java.lang.String sortWeight)
- Sets how the AS/400 or iSeries server treats case while sorting records. This property
has no effect unless the sort property is set to "language".
- Parameters:
sortWeight
- The sort weight.
Valid values include: "shared" (upper- and lower-case characters are sorted as the
same character) and "unique" (upper- and lower-case characters are sorted as
different characters). The default value is "shared".
setThreadUsed
public void setThreadUsed(boolean threadUsed)
- Sets whether a thread is used.
- Parameters:
threadUsed
- true if a thread is used; false otherwise.
The default value is true.
setTimeFormat
public void setTimeFormat(java.lang.String timeFormat)
- Sets the AS/400 or iSeries time format used in time literals with SQL statements.
- Parameters:
timeFormat
- The time format.
Valid values include:
- "hms"
- "usa"
- "iso"
- "eur"
- "jis"
- "" (server job value) - default.
The default value is based on the server job.
setTimeSeparator
public void setTimeSeparator(java.lang.String timeSeparator)
- Sets the AS/400 or iSeries time separator used in time literals within SQL statements.
This property has no effect unless the time format property is set to "hms".
setTrace
public void setTrace(boolean trace)
- Sets whether trace messages should be logged. Trace messages are
useful for debugging programs that call JDBC. However, there is a
performance penalty associated with logging trace messages, so this
property should only be set to true for debugging. Trace messages
are logged to System.out.
- Parameters:
trace
- true if trace message are logged; false otherwise.
The default value is false.
setTransactionIsolation
public void setTransactionIsolation(java.lang.String transactionIsolation)
- Sets the AS/400 or iSeries server's transaction isolation.
- Parameters:
String
- transactionIsolation The transaction isolation level.
Valid values include:
- "none"
- "read uncommitted" - The default value.
- "read committed"
- "repeatable read"
- "serializable"
setTranslateBinary
public void setTranslateBinary(boolean translate)
- Sets whether binary data is translated. If this property is set
to true, then BINARY and VARBINARY fields are treated as CHAR and
VARCHAR fields.
- Parameters:
translate
- true if binary data is translated; false otherwise.
The default value is false.
setUser
public void setUser(java.lang.String user)
- Sets the database user.
- Parameters:
user
- The user.
toString
public java.lang.String toString()
- Returns the string representation of the object.
- Overrides:
toString
in class java.lang.Object
- Returns:
- The string representation.