The AS400JDBCDataSource class represents a factory for IBM i 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 system.
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 IBM i 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");
AS400JDBCDataSource(AS400 as400)
Constructs an AS400JDBCDataSource object with the specified AS400 object
AS400JDBCDataSource(String serverName)
Constructs an AS400JDBCDataSource object to the specified serverName.
AS400JDBCDataSource(String serverName,
String user,
String password)
Constructs an AS400JDBCDataSource object with the specified signon information.
AS400JDBCDataSource(String serverName,
String user,
String password,
String keyRingName,
String keyRingPassword)
Constructs an AS400JDBCDataSource object with the specified signon information
to use for SSL communications with the system.
getPackage()
Returns the base name of the SQL package.
int
getPackageCcsid()
Gets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
int
getPackageCCSID()
Gets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
isHoldStatements()
Indicates whether statements remain open until a transaction boundary when autocommit is off and they
are associated with Lob locators.
boolean
isJvm16Synchronize()
Indicates whether the temporary fix for JVM 1.6 is enabled.
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.
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 IBM i system.
isTranslateBoolean()
Indicates how Boolean objects are interpreted when setting the value
for a character field/parameter using the PreparedStatement.setObject(),
CallableStatement.setObject() or ResultSet.updateObject() methods.
boolean
isTrueAutocommit()
Indicates whether true auto commit support is used.
boolean
isTrueAutoCommit()
Indicates whether true auto commit support is used.
setDriver(String driver)
Sets the JDBC driver implementation.
void
setErrors(String errors)
Sets the amount of detail to be returned in the message for errors
occurring on the IBM i system.
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
IBM i system.
void
setExtendedMetaData(boolean extendedMetaData)
Sets whether the driver should request extended metadata from the
IBM i system.
void
setFullOpen(boolean fullOpen)
Sets whether to fully open a file when performing a query.
void
setHoldInputLocators(boolean value)
Sets whether input locators are allocated as hold locators.
void
setHoldStatements(boolean value)
Sets whether statements should remain open until a transaction boundary when autocommit is off
and they are associated with Lob locators.
setNaming(String naming)
Sets the naming convention used when referring to tables.
void
setPackage(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
setPackageCcsid(int ccsid)
Sets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
void
setPackageCCSID(int ccsid)
Sets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
setProperties(String propertiesString)
Sets the properties based on ";" delimited string of properties, in same
fashion as URL properties specified with
DriverManager.getConnection(urlProperties).
setQueryOptimizeGoal(int goal)
Sets the goal the IBM i system should use with optimization of queries.
void
setQueryStorageLimit(int limit)
Sets the storage limit in megabytes, that should be used for statements executing a query in a connection.
void
setReceiveBufferSize(int size)
This property sets the receive buffer size socket option to the
specified value.
void
setRemarks(String remarks)
Sets the source of the text for REMARKS columns in ResultSets returned
by DatabaseMetaData methods.
void
setRollbackCursorHold(boolean cursorHold)
Sets whether the cursor is held after a rollback.
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(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
setSecondaryURL(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 IBM i system.
void
setSecureCurrentUser(boolean secureCurrentUser)
Sets whether to disallow "" and *current as user name and password.
void
setSendBufferSize(int size)
This property sets the send buffer size socket option to the
specified value.
setSocketTimeout(int milliseconds)
This property enables/disables socket timeout with the
specified value in milliseconds.
void
setSoLinger(int seconds)
This property allows the turning on of socket linger with the
specified linger time in seconds.
void
setSort(String sort)
Sets how the IBM i system sorts records before sending them to the client.
void
setSortLanguage(String language)
Sets the three-character language id to use for selection of a sort sequence.
void
setSortTable(String table)
Sets the library and file name of a sort sequence table stored on the
IBM i system.
void
setSortWeight(String sortWeight)
Sets how the IBM i system treats case while sorting records.
void
setSoTimeout(int milliseconds)
This property enables/disables socket timeout with the
specified value in milliseconds.
void
setTcpNoDelay(boolean noDelay)
This property allows the turning on of the TCP no delay socket option.
void
setThreadUsed(boolean threadUsed)
Sets whether a thread is used.
void
setTimeFormat(String timeFormat)
Sets the time format used in time literals with SQL statements.
void
setTimeSeparator(String timeSeparator)
Sets the time separator used in time literals within SQL statements.
void
setToolboxTrace(String traceCategory)
Sets the toolbox trace category, which indicates
what trace points and diagnostic messages should be logged.
void
setToolboxTraceCategory(String traceCategory)
Sets the toolbox trace category, which indicates
what trace points and diagnostic messages should be logged.
void
setTrace(boolean trace)
Sets whether trace messages should be logged.
setTranslateBinary(boolean translate)
Sets whether binary data is translated.
void
setTranslateBoolean(boolean translate)
Sets how Boolean objects are interpreted when setting the value
for a character field/parameter using the PreparedStatement.setObject(),
CallableStatement.setObject() or ResultSet.updateObject() methods.
void
setTranslateHex(String parseOption)
Sets the translate hex property, which indicates how
the parser will treat hexadecimal literals.
void
setTrueAutocommit(boolean value)
Sets whether true auto commit support is used.
void
setTrueAutoCommit(boolean value)
Sets whether true auto commit support is used.
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.
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.
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.
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.
Adds a PropertyChangeListener. The specified PropertyChangeListener's
propertyChange method is called each time the value of any bound
property is changed.
Returns the level of database access for the 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".
getBehaviorOverride
public int getBehaviorOverride()
Returns what behaviors of the Toolbox JDBC driver have been overridden.
Multiple behaviors can be overridden in combination by adding
the constants and passing that sum on the setBehaviorOverride() method.
Returns:
The behaviors that have been overridden.
The return value is a combination of the following:
1 - Do not throw an exception if Statement.executeQuery() or
PreparedStatement.executeQuery() do not return a result set.
Instead, return null for the result set.
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 system in
blocks of records. Specifying a non-zero value for this property
will reduce the frequency of communication to the system, 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 system 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 system, and therefore may increase performance.
This method returns the concurrent access resolution setting.
This method has no effect on IBM i V6R1 or earlier.
The possible values for this property are CONCURRENTACCESS_NOT_SET,
CONCURRENTACCESS_USE_CURRENTLY_COMMITTED,
CONCURRENTACCESS_WAIT_FOR_OUTCOME and
CONCURRENTACCESS_SKIP_LOCKS,
with the property defaulting to CONCURRENTACCESS_NOT_SET.
Setting this property to default exhibits the default behavior on the servers
i.e., the semantic applied for read
transactions to avoid locks will be determined by the server.
CONCURRENTACCESS_USE_CURRENTLY_COMMITTED specifies that driver will flow USE CURRENTLY COMMITTED
to server. Whether CURRENTLY COMMITTED will actually be in effect is
ultimately determined by server.
CONCURRENTACCESS_WAIT_FOR_OUTCOME specifies that driver will flow WAIT FOR OUTCOME
to server. This will disable the CURRENTLY COMMITTED behavior at the server,
if enabled, and the server will wait for the commit or rollback of data in the process of
being updated.
CONCURRENTACCESS_SKIP_LOCKS specifies that driver will flow SKIP LOCKS
to server. This directs the database manager to skip records in the case of record lock conflicts.
Returns the value of the cursor sensitivity property. If the resultSetType is
ResultSet.TYPE_FORWARD_ONLY or ResultSet.TYPE_SCROLL_SENSITIVE, the value of this property
will control what cursor sensitivity is requested from the database. If the resultSetType
is ResultSet.TYPE_SCROLL_INSENSITIVE, this property will be ignored.
Returns:
The cursor sensitivity.
Valid values include:
"asensitive"
"insensitive"
"sensitive"
The default is "asensitive".
This property is ignored when connecting to systems
running OS/400 V5R1 and earlier.
Returns the IBM i 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 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 IBM i Java Virtual Machine.
Valid values include:
"toolbox" (use the IBM Toolbox for Java JDBC driver)
"native" (use the IBM Developer Kit for Java JDBC driver)
Returns the IBM i system 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 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 system. Larger LOB thresholds will reduce
the frequency of communication to the system, but will download
more LOB data, even if it is not used. Smaller LOB thresholds may
increase frequency of communication to the system, but will only
download LOB data as it is needed.
Returns:
The lob threshold. Valid range is 0-16777216.
The default value is 32768.
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 IBM i system.
Indicates how to retrieve DatabaseMetaData.
If set to 0, database metadata will be retrieved through the ROI data flow.
If set to 1, database metadata will be retrieved by calling system stored procedures.
The methods that currently are available through stored procedures are:
getColumnPrivileges
Returns:
the metadata setting.
The default value is 1.
getMetadataSource
public int getMetadataSource()
Indicates how to retrieve DatabaseMetaData.
If set to 0, database metadata will be retrieved through the ROI data flow.
If set to 1, database metadata will be retrieved by calling system stored procedures.
The methods that currently are available through stored procedures are:
getColumnPrivileges
Returns:
the metadata setting.
The default value is 1.
Note: this method is the same as getMetaDataSource() so that it corresponds to the connection property name
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 system.
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 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".
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".
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.
Returns the level of tracing started on the JDBC server job.
If tracing is enabled, tracing is started when
the client connects to the system and ends when the connection
is disconnected. Tracing must be started before connecting to
the system since the client enables system tracing only at connect time.
Trace data is collected in spooled files on the system. Multiple
levels of tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
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 system resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on tracing only to debug
a problem as directed by IBM service.
getServerTrace
public int getServerTrace()
Returns the level of tracing started on the JDBC server job.
If tracing is enabled, tracing is started when
the client connects to the system and ends when the connection
is disconnected. Tracing must be started before connecting to
the system since the client enables system tracing only at connect time.
Trace data is collected in spooled files on the system. Multiple
levels of tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
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 system resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on tracing only to debug
a problem as directed by IBM service.
Note: this method is the same as getServerTraceCategories() so that it corresponds to the connection property name
Returns how the system 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".
The QAQQINI library name.
Note: this method is the same as getQaqqiniLibrary() so that it corresponds to the connection property name
getQueryOptimizeGoal
public int getQueryOptimizeGoal()
Returns the goal the IBM i system should use with optimization of queries.
Returns:
the goal the IBM i system should use with optimization of queries.
Valid values include:
0 = Optimize query for first block of data (*ALLIO) when extended dynamic packages are used; Optimize query for entire result set (*FIRSTIO) when packages are not used
1 = Optimize query for first block of data (*FIRSTIO)
2 = Optimize query for entire result set (*ALLIO)
The default value is 0.
getQueryStorageLimit
public int getQueryStorageLimit()
Returns the storage limit in megabytes, that should be used for statements executing a query in a connection.
Note, this setting is ignored when running to i5/OS V5R4 or earlier
You must have *JOBCTL special authority to use query storage limit with Version 6 Release 1 of IBM i.
Valid values are -1 to MAX_STORAGE_LIMIT megabytes.
The default value is -1 meaning there is no limit.
getXALooselyCoupledSupport
public int getXALooselyCoupledSupport()
Indicates whether lock sharing is allowed for loosely coupled transaction branches.
Returns:
the lock sharing setting.
Valid values include:
0 = Locks cannot be shared
1 = Locks can be shared
The default value is 0.
isTrueAutoCommit
public boolean isTrueAutoCommit()
Indicates whether true auto commit support is used.
Returns:
true if true auto commit support is used; false otherwise.
The default value is false.
isTrueAutocommit
public boolean isTrueAutocommit()
Indicates whether true auto commit support is used.
Returns:
true if true auto commit support is used; false otherwise.
The default value is false.
Note: this method is the same as isTrueAutoCommit() so that it corresponds to the connection property name
isVariableFieldCompression
public boolean isVariableFieldCompression()
Indicates whether variable-length fields are compressed.
Returns:
true if variable-length fields are compressed; false otherwise.
The default value is true.
isAutoCommit
public boolean isAutoCommit()
Returns whether auto-commit mode is the default connection mode for new connections.
Returns:
Auto commit.
The default value is true.
isAutocommitException
public boolean isAutocommitException()
Returns whether commit or rollback throws SQLException when autocommit is enabled.
Returns:
Autocommit Exception.
The default value is false.
isBidiImplicitReordering
public boolean isBidiImplicitReordering()
Indicates whether bidi implicit reordering is used.
Returns:
true if bidi implicit reordering is used; false otherwise.
The default value is true.
isBidiNumericOrdering
public boolean isBidiNumericOrdering()
Indicates whether bidi numeric ordering round trip is used.
Returns:
true if bidi numeric ordering round trip is used; false otherwise.
The default value is false.
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 system. The first time a particular SQL statement is prepared, it is
stored in an SQL package on the system.
If the package does not exist, it will be automatically created.
On subsequent prepares of the
same SQL statement, the system 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
IBM i system. 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 system to make a judgment. Setting
this property to true forces the driver to get the correct data from the IBM i system.
Returns:
true if extended metadata will be requested; false otherwise.
The default value is false.
isExtendedMetadata
public boolean isExtendedMetadata()
Indicates whether the driver should request extended metadata from the
IBM i system. 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 system to make a judgment. Setting
this property to true forces the driver to get the correct data from the IBM i system.
Returns:
true if extended metadata will be requested; false otherwise.
The default value is false.
Note: this method is the same as isExtendedMetaData() so that it corresponds to the connection property name
isFullOpen
public boolean isFullOpen()
Indicates whether the IBM i system fully opens a file when performing a query.
By default the system 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 system.
Returns:
true if files are fully opened; false otherwise.
The default value is false.
isJvm16Synchronize
public boolean isJvm16Synchronize()
Indicates whether the temporary fix for JVM 1.6 is enabled.
Returns:
true if enabled; false otherwise.
The default value is true.
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.
isHoldInputLocators
public boolean isHoldInputLocators()
Indicates whether input locators are of type hold.
Returns:
true if input locators are of type hold; false otherwise.
The default value is true.
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 IBM i system 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 IBM i system. 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.
isRollbackCursorHold
public boolean isRollbackCursorHold()
Indicates whether the cursor is held after a rollback.
Returns:
true if the cursor is held; false otherwise.
The default value is false.
isHoldStatements
public boolean isHoldStatements()
Indicates whether statements remain open until a transaction boundary when autocommit is off and they
are associated with Lob locators.
Returns:
true if statements are only closed at transaction boundaries; 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 IBM i system. 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 IBM i system. SSL connections are only available when connecting to systems
at V4R4 or later.
Returns:
true if Secure Socket Layer connection is used; false otherwise.
The default value is false.
isSecureCurrentUser
public boolean isSecureCurrentUser()
Returns the secure current user setting. True indicates to disallow "" and *current for user name and password.
Returns:
The secure current user setting.
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.
isTranslateBoolean
public boolean isTranslateBoolean()
Indicates how Boolean objects are interpreted when setting the value
for a character field/parameter using the PreparedStatement.setObject(),
CallableStatement.setObject() or ResultSet.updateObject() methods. Setting the
property to "true", would store the Boolean object in the character field as either
"true" or "false". Setting the property to "false", would store the Boolean object
in the character field as either "1" or "0".
Returns:
true if boolean data is translated; false otherwise.
The default value is true.
Sets the level of database access for the 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".
setAutoCommit
public void setAutoCommit(boolean value)
Sets whether auto-commit mode is the default connection mode for new connections.
Parameters:
value - The default value is true.
setAutocommitException
public void setAutocommitException(boolean value)
Sets whether commit or rollback throws SQLException when autocommit is enabled.
Parameters:
value - The default value is false.
setTrueAutoCommit
public void setTrueAutoCommit(boolean value)
Sets whether true auto commit support is used.
Parameters:
value - true if true auto commit support should be used; false otherwise.
The default value is false.
setTrueAutocommit
public void setTrueAutocommit(boolean value)
Sets whether true auto commit support is used.
Parameters:
value - true if true auto commit support should be used; false otherwise.
The default value is false.
Note: this method is the same as setTrueAutoCommit() so that it corresponds to the connection property nameproperty name
setBehaviorOverride
public void setBehaviorOverride(int behaviors)
Sets the Toolbox JDBC Driver behaviors to override. Multiple
behaviors can be changed in combination by adding
the constants and passing that sum on the this method.
Parameters:
behaviors - The driver behaviors to override.
Valid values include:
1 - Do not throw an exception if Statement.executeQuery() or
PreparedStatement.executeQuery() do not return a result set.
Instead, return null for the result set.
Carefully consider the result of overriding the default behavior of the
driver. For example, setting the value of this property to 1 means
the driver will no longer throw an exception even though the JDBC 3.0
specification states throwing an exception is the correct behavior.
Be sure your application correctly handles the altered behavior.
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.
setBidiImplicitReordering
public void setBidiImplicitReordering(boolean value)
Sets whether bidi implicit reordering is used.
Parameters:
value - true if implicit reordering should be used; false otherwise.
The default value is true.
setBidiNumericOrdering
public void setBidiNumericOrdering(boolean value)
Sets whether bidi numeric ordering round trip is used.
Parameters:
value - true if numeric ordering round trip should be used; false otherwise.
The default value is false.
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 IBM i system in
blocks of records. Specifying a non-zero value for this property
will reduce the frequency of communication to the system, 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 IBM i system 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 system, 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
setConcurrentAccessResolution
public void setConcurrentAccessResolution(int concurrentAccessResolution)
This method sets concurrent access resolution. This method overrides the setting of ConcurrentAccessResolution on the datasource or connection
URL properties. This method has no effect on
IBM i V6R1 or earlier.
The possible values for this property are CONCURRENTACCESS_NOT_SET,
CONCURRENTACCESS_USE_CURRENTLY_COMMITTED,
CONCURRENTACCESS_WAIT_FOR_OUTCOME and
CONCURRENTACCESS_SKIP_LOCKS,
with the property defaulting to CONCURRENTACCESS_NOT_SET.
Setting this property to default exhibits the default behavior on the servers
i.e., the semantic applied for read
transactions to avoid locks will be determined by the server.
CONCURRENTACCESS_USE_CURRENTLY_COMMITTED specifies that driver will flow USE CURRENTLY COMMITTED
to server. Whether CURRENTLY COMMITTED will actually be in effect is
ultimately determined by server.
CONCURRENTACCESS_WAIT_FOR_OUTCOME specifies that driver will flow WAIT FOR OUTCOME
to server. This will disable the CURRENTLY COMMITTED behavior at the server,
if enabled, and the server will wait for the commit or rollback of data in the process of
being updated.
CONCURRENTACCESS_SKIP_LOCKS specifies that driver will flow SKIP LOCKS
to server. This directs the database manager to skip records in the case of record lock conflicts.
public void setCursorSensitivity(String cursorSensitivity)
Sets the cursor sensitivity to be requested from the database. If the resultSetType is
ResultSet.TYPE_FORWARD_ONLY or ResultSet.TYPE_SCROLL_SENSITIVE, the value of this property
will control what cursor sensitivity is requested from the database. If the resultSetType
is ResultSet.TYPE_SCROLL_INSENSITIVE, this property will be ignored.
Valid values include:
"asensitive"
"insensitive"
"sensitive"
The default is "asensitive".
This property is ignored when connecting to systems
running OS/400 V5R1 and earlier.
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.
Sets the database name.
This property is ignored when connecting to systems
running OS/400 V5R1 and earlier.
If a database name is specified it must exist in the relational
database directory on the system. Use CL 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(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.
Sets the 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(String dateSeparator)
Sets the 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.
setDecfloatRoundingMode
public void setDecfloatRoundingMode(String decfloatRoundingMode)
Sets the decfloat rounding mode.
Parameters:
decfloatRoundingMode - The decfloat rounding mode.
Valid values include:
"half even" - default
"half up"
"down"
"ceiling"
"floor"
"half down"
"up"
setDecimalSeparator
public void setDecimalSeparator(String decimalSeparator)
Sets the 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.
setIgnoreWarnings
public void setIgnoreWarnings(String ignoreWarnings)
Sets the ignore warnings property.
Parameters:
ignoreWarnings - Specifies a list of SQL states for which the driver should not create warning objects.
Sets the amount of detail to be returned in the message for errors
occurring on the IBM i system.
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 IBM i system. The first time a particular SQL statement is prepared, it is
stored in an SQL package on the system.
If the package does not exist, it will be automatically created.
On subsequent prepares of the
same SQL statement, the system 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
IBM i system. This property is ignored when connecting to systems
running OS/400 V5R1 and earlier.
If this property is set to true and connecting to a system running
OS/400 V5R2 or IBM i, 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 system to make a judgment. Setting
this property to true forces the driver to get the correct data from the system.
Parameters:
extendedMetaData - True to request extended metadata from the system, false otherwise.
The default value is false.
setExtendedMetadata
public void setExtendedMetadata(boolean extendedMetaData)
Sets whether the driver should request extended metadata from the
IBM i system. This property is ignored when connecting to systems
running OS/400 V5R1 and earlier.
If this property is set to true and connecting to a system running
OS/400 V5R2 or IBM i, 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 system to make a judgment. Setting
this property to true forces the driver to get the correct data from the system.
Parameters:
extendedMetaData - True to request extended metadata from the system, false otherwise.
The default value is false.
Note: this method is the same as setExtendedMetaData() so that it corresponds to the connection property name
setFullOpen
public void setFullOpen(boolean fullOpen)
Sets whether to fully open a file when performing a query.
By default the IBM i system 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.
setHoldInputLocators
public void setHoldInputLocators(boolean value)
Sets whether input locators are allocated as hold locators.
Parameters:
value - true if locators should be allocated as hold locators; false otherwise.
The default value is true.
setHoldStatements
public void setHoldStatements(boolean value)
Sets whether statements should remain open until a transaction boundary when autocommit is off
and they are associated with Lob locators.
Parameters:
value - true if statements should remain open; false otherwise.
The default value is false.
setJvm16Synchronize
public void setJvm16Synchronize(boolean value)
Indicates whether the temporary fix for JVM 1.6 is enabled.
Parameters:
value - true if JVM 1.6 fix is enabled; false otherwise.
The default value is true.
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.
Sets the 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 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 IBM i system. Larger LOB thresholds will reduce
the frequency of communication to the system, but will download
more LOB data, even if it is not used. Smaller LOB thresholds may
increase frequency of communication to the system, but will only
download LOB data as it is needed.
Parameters:
threshold - The lob threshold. Valid range is 0-16777216.
The default value is 32768.
setLoginTimeout
public void setLoginTimeout(int timeout)
throws 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.
Sets how to retrieve DatabaseMetaData.
If set to 0, database metadata will be retrieved through the ROI data flow.
If set to 1, database metadata will be retrieved by calling system stored procedures.
The methods that currently are available through stored procedures are:
getColumnPrivileges
Parameters:
mds - The setting for metadata source
The default value is 1.
setMetadataSource
public void setMetadataSource(int mds)
Sets how to retrieve DatabaseMetaData.
If set to 0, database metadata will be retrieved through the ROI data flow.
If set to 1, database metadata will be retrieved by calling system stored procedures.
The methods that currently are available through stored procedures are:
getColumnPrivileges
Parameters:
mds - The setting for metadata source
The default value is 1.
Note: this method is the same as setMetaDataSource() so that it corresponds to the connection property name
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 IBM i system.
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 IBM i system 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(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".
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(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 package library is "QGPL".
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 IBM i system. 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.
setProperties
public void setProperties(String propertiesString)
Sets the properties based on ";" delimited string of properties, in same
fashion as URL properties specified with
DriverManager.getConnection(urlProperties). This method simply parses
property string and then calls setPropertes(Properties). This method is
intended as an enhancement so that the user does not have to write new
code to call the setters for new/deleted properties.
Parameters:
propertiesString - list of ";" delimited properties
setProperties
public void setProperties(Properties newProperties)
Sets the properties for this datasource. This method is intended as an
enhancement so that the user does not have to write new code to call the
setters for new/deleted properties.
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 DB2 for IBM i. Use a backslash as an escape character
before backslashes and semicolons in the 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 DB2 for IBM i. Use a backslash as an escape character
before backslashes and semicolons in the URL.
Parameters:
url - The secondary URL.
Note: this method is the same as setSecondaryUrl() so that it corresponds to the connection property name
setSecure
public void setSecure(boolean secure)
Sets whether a Secure Socket Layer (SSL) connection is used to communicate
with the IBM i system. SSL connections are only available when connecting to systems
at V4R4 or later.
Parameters:
secure - true if Secure Socket Layer connection is used; false otherwise.
The default value is false.
setSecureCurrentUser
public void setSecureCurrentUser(boolean secureCurrentUser)
Sets whether to disallow "" and *current as user name and password.
True indicates to disallow "" and *current for user name and password.
Parameters:
secureCurrentUser - The secure current user setting.
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 IBM i system, and ends when the connection
is disconnected. Tracing must be started before connecting to
the system since the client enables tracing only at connect time.
Trace data is collected in spooled files on the system. Multiple
levels of tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
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 system resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on tracing only to debug
a problem as directed by IBM service.
setServerTrace
public void setServerTrace(int traceCategories)
Enables tracing of the JDBC server job.
If tracing is enabled, tracing is started when
the client connects to the IBM i system, and ends when the connection
is disconnected. Tracing must be started before connecting to
the system since the client enables tracing only at connect time.
Trace data is collected in spooled files on the system. Multiple
levels of tracing can be turned on in combination by adding
the constants and passing that sum on the set method. For example,
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 system resources.
Additional processor resource is used to collect the data, and additional
storage is used to save the data. Turn on tracing only to debug
a problem as directed by IBM service.
Note: this method is the same as setServerTraceCategories() so that it corresponds to the connection property name
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 IBM i Java Virtual Machine.
param driver The driver value.
Valid values include:
"toolbox" (use the IBM Toolbox for Java JDBC driver)
"native" (use the IBM Developer Kit for Java JDBC driver)
The default value is "toolbox".
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 IBM i system. 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
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 ENU.
Sets the library and file name of a sort sequence table stored on the
IBM i system.
This property has no effect unless the sort property is set to "table".
The default is an empty String ("").
Sets how the IBM i system 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.
Sets the 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(String timeSeparator)
Sets the time separator used in time literals within SQL statements.
This property has no effect unless the time format property is set to "hms".
Parameters:
timeSeparator - The time separator.
Valid values include:
":" (colon)
"." (period)
"," (comma)
" " (space)
"" (server job value) - default.
The default value is based on the server job.
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(String transactionIsolation)
Sets the IBM i system's transaction isolation.
Parameters:
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.
setTranslateBoolean
public void setTranslateBoolean(boolean translate)
Sets how Boolean objects are interpreted when setting the value
for a character field/parameter using the PreparedStatement.setObject(),
CallableStatement.setObject() or ResultSet.updateObject() methods. Setting the
property to "true", would store the Boolean object in the character field as either
"true" or "false". Setting the property to "false", would store the Boolean object
in the character field as either "1" or "0".
Parameters:
translate - true if boolean data is translated; false otherwise.
The default value is true.
public void setVariableFieldCompression(boolean compress)
Specifies whether variable-length fields should be compressed.
Parameters:
compress - true if variable-length fields should be compressed; false otherwise.
The default value is true.
getKeepAlive
public boolean getKeepAlive()
Gets the socket keepalive option.
Returns:
The value of the socket keepalive option.
getReceiveBufferSize
public int getReceiveBufferSize()
Gets the socket receive buffer size option. NOTE: This does not get
the actual receive buffer size, only the option which is used as a hint
by the underlying socket code.
Returns:
The value of the socket receive buffer size option.
getSendBufferSize
public int getSendBufferSize()
Gets the socket send buffer size option. NOTE: This does not get
the actual send buffer size, only the option which is used as a hint
by the underlying socket code.
Returns:
The value of the socket send buffer size option.
getSoLinger
public int getSoLinger()
Gets the socket linger option in seconds.
Returns:
The value of the socket linger option.
getSoTimeout
public int getSoTimeout()
Gets the socket timeout option in milliseconds.
Returns:
The value of the socket timeout option.
getTcpNoDelay
public boolean getTcpNoDelay()
Gets the socket TCP no delay option.
Returns:
The value of the socket TCP no delay option.
setKeepAlive
public void setKeepAlive(boolean keepAlive)
This property allows the turning on of socket keep alive.
Parameters:
keepAlive - The keepalive option value.
setReceiveBufferSize
public void setReceiveBufferSize(int size)
This property sets the receive buffer size socket option to the
specified value. The receive buffer size option is used as a hint
for the size to set the underlying network I/O buffers. Increasing
the receive buffer size can increase the performance of network
I/O for high-volume connection, while decreasing it can help reduce
the backlog of incoming data. This value must be greater than 0.
Parameters:
size - The socket receive buffer size option value.
setSendBufferSize
public void setSendBufferSize(int size)
This property sets the send buffer size socket option to the
specified value. The send buffer size option is used by the
platform's networking code as a hint for the size to set the
underlying network I/O buffers. This value must be greater
than 0.
Parameters:
size - The socket send buffer size option value.
setSoLinger
public void setSoLinger(int seconds)
This property allows the turning on of socket linger with the
specified linger time in seconds. The maxium value for this
property is platform specific.
Parameters:
seconds - The socket linger option value.
setSoTimeout
public void setSoTimeout(int milliseconds)
This property enables/disables socket timeout with the
specified value in milliseconds. A timeout value must be
greater than zero, a value of zero for this property indicates
infinite timeout.
Parameters:
milliseconds - The socket timeout option value.
setSocketTimeout
public void setSocketTimeout(int milliseconds)
This property enables/disables socket timeout with the
specified value in milliseconds. A timeout value must be
greater than zero, a value of zero for this property indicates
infinite timeout.
Parameters:
milliseconds - The socket timeout option value.
setTcpNoDelay
public void setTcpNoDelay(boolean noDelay)
This property allows the turning on of the TCP no delay socket option.
Parameters:
noDelay - The socket TCP no delay option value.
getPackageCCSID
public int getPackageCCSID()
Gets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
Valid values: 1200 (UCS-2) and 13488 (UTF-16).
Default value: 13488
Returns:
The value of the package CCSID property.
getPackageCcsid
public int getPackageCcsid()
Gets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
Valid values: 1200 (UCS-2) and 13488 (UTF-16).
Default value: 13488
Returns:
The value of the package CCSID property.
Note: this method is the same as getPackageCCSID() so that it corresponds to the connection property name
setPackageCCSID
public void setPackageCCSID(int ccsid)
Sets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
Valid values: 1200 (UCS-2) and 13488 (UTF-16).
Default value: 13488
Parameters:
ccsid - The package CCSID.
setPackageCcsid
public void setPackageCcsid(int ccsid)
Sets the package CCSID property, which indicates the
CCSID in which statements are sent to the IBM i system and
also the CCSID of the package they are stored in.
Valid values: 1200 (UCS-2) and 13488 (UTF-16).
Default value: 13488
Parameters:
ccsid - The package CCSID.
Note: this method is the same as setPackageCCSID() so that it corresponds to the connection property name
getMinimumDivideScale
public int getMinimumDivideScale()
Gets the minimum divide scale property. This property ensures the scale
of the result of decimal division is never less than its specified value.
Valid values: 0-9. 0 is default.
Returns:
The minimum divide scale.
getMaximumPrecision
public int getMaximumPrecision()
Gets the maximum precision property. This property indicates the
maximum decimal precision the IBM i system should use.
Valid values: 31 or 63. 31 is default.
Returns:
The maximum precision.
getMaximumScale
public int getMaximumScale()
Gets the maximum scale property. This property indicates the
maximum decimal scale the IBM i system should use.
Valid values: 0-63. 31 is default.
Returns:
The maximum scale.
setMinimumDivideScale
public void setMinimumDivideScale(int scale)
Sets the minimum divide scale property. This property ensures the scale
of the result of decimal division is never less than its specified value.
Valid values: 0-9. 0 is default.
Parameters:
scale - The minimum divide scale.
setMaximumPrecision
public void setMaximumPrecision(int precision)
Sets the maximum precision property. This property indicates the
maximum decimal precision the IBM i system should use.
Valid values: 31 or 63. 31 is default.
Parameters:
precision - The maximum precision.
setMaximumScale
public void setMaximumScale(int scale)
Sets the maximum scale property. This property indicates the
maximum decimal scale the IBM i system should use.
Valid values: 0-63. 31 is default.
libraryName - The QAQQINI library name.
Note: this method is the same as setQaqqiniLibrary() so that it corresponds to the connection property name
setQueryOptimizeGoal
public void setQueryOptimizeGoal(int goal)
Sets the goal the IBM i system should use with optimization of queries.
This setting corresponds with the system's QAQQINI option called OPTIMIZATION_GOAL.
Note, this setting is ignored when running to V5R3 IBM i or earlier
Parameters:
goal - - the optimization goal
Valid values include:
0 = Optimize query for first block of data (*ALLIO) when extended dynamic packages are used; Optimize query for entire result set (*FIRSTIO) when packages are not used
1 = Optimize query for first block of data (*FIRSTIO)
2 = Optimize query for entire result set (*ALLIO)
The default value is 0.
setQueryStorageLimit
public void setQueryStorageLimit(int limit)
Sets the storage limit in megabytes, that should be used for statements executing a query in a connection.
Note, this setting is ignored when running to i5/OS V5R4 or earlier
You must have *JOBCTL special authority to use query storage limit with Version 6 Release 1 of IBM i.
Parameters:
limit - the storage limit (in megabytes)
Valid values are -1 to MAX_STORAGE_LIMIT megabytes.
The default value is -1 meaning there is no limit.
setXALooselyCoupledSupport
public void setXALooselyCoupledSupport(int lcs)
Sets whether lock sharing is allowed for loosely coupled transaction branches.
Note, this setting is ignored when running to V5R3 IBM i or earlier.