|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ibm.as400.access.AS400JDBCDataSource
The AS400JDBCDataSource class represents a factory for OS/400 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 server. 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 OS/400 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");
| Field Summary | |
static int |
SERVER_TRACE_DEBUG_SERVER_JOB
Start debug on the JDBC server job. |
static int |
SERVER_TRACE_SAVE_SERVER_JOBLOG
Save the joblog when the JDBC server job ends. |
static int |
SERVER_TRACE_SAVE_SQL_INFORMATION
Save SQL information. |
static int |
SERVER_TRACE_START_DATABASE_MONITOR
Start the database monitor on the JDBC server job. |
static int |
SERVER_TRACE_TRACE_SERVER_JOB
Start job trace on the JDBC server job. |
| Constructor Summary | |
AS400JDBCDataSource()
Constructs a default AS400JDBCDataSource object. |
|
AS400JDBCDataSource(AS400 as400)
Constructs an AS400JDBCDataSource object with the specified AS400 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 OS/400 connection. |
int |
getBehaviorOverride()
Returns what behaviors of the Toolbox JDBC driver have been overridden. |
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 server in blocks of records. |
int |
getBlockSize()
Returns the block size in kilobytes to retrieve from the 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 |
getCursorSensitivity()
Returns the value of the cursor sensitivity property. |
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 OS/400 date format used in date literals within SQL statements. |
java.lang.String |
getDateSeparator()
Returns the OS/400 date separator used in date literals within SQL statements. |
java.lang.String |
getDecimalSeparator()
Returns the OS/400 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 server. |
boolean |
getKeepAlive()
Gets the socket keepalive option. |
java.lang.String |
getLibraries()
Returns the OS/400 libraries to add to the server job's library list. |
int |
getLobThreshold()
Returns the OS/400 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. |
int |
getMaximumPrecision()
Gets the maximum precision property. |
int |
getMaximumScale()
Gets the maximum scale property. |
int |
getMinimumDivideScale()
Gets the minimum divide scale property. |
java.lang.String |
getNaming()
Returns the OS/400 naming convention used when referring to tables. |
java.lang.String |
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 server and also the CCSID of the package they are stored in. |
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. |
java.lang.String |
getQaqqiniLibrary()
Returns the QAQQINI library name. |
int |
getReceiveBufferSize()
Gets the socket receive buffer size option. |
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. |
int |
getSendBufferSize()
Gets the socket send buffer size option. |
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. |
int |
getSoLinger()
Gets the socket linger option in seconds. |
java.lang.String |
getSort()
Returns how OS/400 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 server. |
java.lang.String |
getSortWeight()
Returns how OS/400 treats case while sorting records. |
int |
getSoTimeout()
Gets the socket timeout option in milliseconds. |
boolean |
getTcpNoDelay()
Gets the socket TCP no delay option. |
java.lang.String |
getTimeFormat()
Returns the OS/400 time format used in time literals with SQL statements. |
java.lang.String |
getTimeSeparator()
Returns the OS/400 time separator used in time literals within SQL statements. |
java.lang.String |
getToolboxTraceCategory()
Returns the toolbox trace category. |
java.lang.String |
getTransactionIsolation()
Returns the server's transaction isolation. |
java.lang.String |
getTranslateHex()
Gets the translate hex property, which indicates how the parser will treat hexadecimal literals. |
java.lang.String |
getUser()
Returns the database user property. |
boolean |
isBidiImplicitReordering()
Indicates whether bidi implicit reordering is used. |
boolean |
isBidiNumericOrdering()
Indicates whether bidi numeric ordering round trip is used. |
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 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. |
boolean |
isTrueAutoCommit()
Indicates whether true auto commit support is used. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener. |
void |
setAccess(java.lang.String access)
Sets the level of database access for the OS/400 connection. |
void |
setBehaviorOverride(int behaviors)
Sets the Toolbox JDBC Driver behaviors to override. |
void |
setBidiImplicitReordering(boolean value)
Sets whether bidi implicit reordering is used. |
void |
setBidiNumericOrdering(boolean value)
Sets whether bidi numeric ordering round trip is used. |
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 server in blocks of records. |
void |
setBlockSize(int blockSize)
Sets the block size in kilobytes to retrieve from the server and cache on the client. |
void |
setCursorHold(boolean cursorHold)
Sets whether the cursor is held. |
void |
setCursorSensitivity(java.lang.String cursorSensitivity)
Sets the cursor sensitivity to be requested from the database. |
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 OS/400 date format used in date literals within SQL statements. |
void |
setDateSeparator(java.lang.String dateSeparator)
Sets the OS/400 date separator used in date literals within SQL statements. |
void |
setDecimalSeparator(java.lang.String decimalSeparator)
Sets the OS/400 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 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 |
setKeepAlive(boolean keepAlive)
This property allows the turning on of socket keep alive. |
void |
setLazyClose(boolean lazyClose)
Sets whether to delay closing cursors until subsequent requests. |
void |
setLibraries(java.lang.String libraries)
Sets the OS/400 libraries to add to the server job's library list. |
void |
setLobThreshold(int threshold)
Sets the OS/400 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 |
setMaximumPrecision(int precision)
Sets the maximum precision property. |
void |
setMaximumScale(int scale)
Sets the maximum scale property. |
void |
setMinimumDivideScale(int scale)
Sets the minimum divide scale property. |
void |
setNaming(java.lang.String naming)
Sets the OS/400 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 |
setPackageCCSID(int ccsid)
Sets the package CCSID property, which indicates the CCSID in which statements are sent to the server and also the CCSID of the package they are stored in. |
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 server. |
void |
setProxyServer(java.lang.String proxyServer)
Sets the name of the proxy server. |
void |
setQaqqiniLibrary(java.lang.String libraryName)
Sets the QAQQINI library name. |
void |
setReceiveBufferSize(int size)
This property sets the receive buffer size socket option to the specified value. |
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 |
setSendBufferSize(int size)
This property sets the send buffer size socket option to the specified value. |
void |
setServerName(java.lang.String serverName)
Sets the iSeries server name. |
void |
setServerTraceCategories(int traceCategories)
Enables tracing of the JDBC server job. |
void |
setSoLinger(int seconds)
This property allows the turning on of socket linger with the specified linger time in seconds. |
void |
setSort(java.lang.String sort)
Sets how OS/400 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 server. |
void |
setSortWeight(java.lang.String sortWeight)
Sets how the server 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(java.lang.String timeFormat)
Sets the OS/400 time format used in time literals with SQL statements. |
void |
setTimeSeparator(java.lang.String timeSeparator)
Sets the OS/400 time separator used in time literals within SQL statements. |
void |
setToolboxTraceCategory(java.lang.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. |
void |
setTransactionIsolation(java.lang.String transactionIsolation)
Sets the OS/400 server's transaction isolation. |
void |
setTranslateBinary(boolean translate)
Sets whether binary data is translated. |
void |
setTranslateHex(java.lang.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 |
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 |
| Field Detail |
public static final int SERVER_TRACE_START_DATABASE_MONITOR
public static final int SERVER_TRACE_DEBUG_SERVER_JOB
public static final int SERVER_TRACE_SAVE_SERVER_JOBLOG
public static final int SERVER_TRACE_TRACE_SERVER_JOB
public static final int SERVER_TRACE_SAVE_SQL_INFORMATION
| Constructor Detail |
public AS400JDBCDataSource()
public AS400JDBCDataSource(java.lang.String serverName)
serverName - The name of the server.
public AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password)
serverName - The name of the server.user - The user id.password - The user password.public AS400JDBCDataSource(AS400 as400)
as400 - The AS400 object
public AS400JDBCDataSource(java.lang.String serverName,
java.lang.String user,
java.lang.String password,
java.lang.String keyRingName,
java.lang.String keyRingPassword)
serverName - The name of the 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.| Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)public java.lang.String getAccess()
public int getBehaviorOverride()
The return value is a combination of the following:
public int getBidiStringType()
public int getBlockCriteria()
Valid values include:
public int getBlockSize()
Valid values include:
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - If a database error occurs.
public java.sql.Connection getConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceuser - The database user.password - The database password.
java.sql.SQLException - If a database error occurs.public java.lang.String getCursorSensitivity()
Valid values include:
public java.lang.String getDatabaseName()
public java.lang.String getDataSourceName()
public java.lang.String getDateFormat()
Valid values include:
public java.lang.String getDateSeparator()
Valid values include:
public java.lang.String getDecimalSeparator()
Valid values include:
public java.lang.String getDescription()
public java.lang.String getDriver()
Valid values include:
public java.lang.String getErrors()
public java.lang.String getLibraries()
public int getLobThreshold()
public int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSource
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.DataSourcejava.sql.SQLException - If a database error occurs.public java.lang.String getNaming()
public java.lang.String getPackage()
public java.lang.String getPackageCriteria()
public java.lang.String getPackageError()
public java.lang.String getPackageLibrary()
public java.lang.String getProxyServer()
public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingException - If a naming error occurs in resolving the object.public java.lang.String getRemarks()
public java.lang.String getSecondaryUrl()
public java.lang.String getServerName()
public int getServerTraceCategories()
dataSource.setServerTraceCategories(AS400JDBCDataSource.SERVER_TRACE_START_DATABASE_MONITOR + AS400JDBCDataSource.SERVER_TRACE_SAVE_SERVER_JOBLOG);
The value is a combination of the following:
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.
public java.lang.String getSort()
Valid values include:
public java.lang.String getSortLanguage()
public java.lang.String getSortTable()
public java.lang.String getSortWeight()
public java.lang.String getTimeFormat()
Valid values include:
public java.lang.String getTimeSeparator()
Valid values include:
public java.lang.String getTransactionIsolation()
Valid values include:
public java.lang.String getUser()
public java.lang.String getQaqqiniLibrary()
public boolean isTrueAutoCommit()
public boolean isBidiImplicitReordering()
public boolean isBidiNumericOrdering()
public boolean isBigDecimal()
public boolean isCursorHold()
public boolean isDataCompression()
public boolean isDataTruncation()
public boolean isExtendedDynamic()
public boolean isExtendedMetaData()
public boolean isFullOpen()
public boolean isLazyClose()
public boolean isPackageAdd()
public boolean isPackageCache()
public boolean isPackageClear()
public boolean isPrefetch()
public boolean isPrompt()
public boolean isSavePasswordWhenSerialized()
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.
public boolean isSecure()
public boolean isThreadUsed()
public boolean isTrace()
public boolean isTranslateBinary()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)public void setAccess(java.lang.String access)
access - The access level.
Valid values include:
public void setTrueAutoCommit(boolean value)
value - true if true auto commit support should be used; false otherwise.
The default value is true.public void setBehaviorOverride(int behaviors)
behaviors - The driver behaviors to override.
Valid values include:
public void setBidiStringType(int bidiStringType)
public void setBidiImplicitReordering(boolean value)
value - true if implicit reordering should be used; false otherwise.
The default value is true.public void setBidiNumericOrdering(boolean value)
value - true if numeric ordering round trip should be used; false otherwise.
The default value is false.public void setBigDecimal(boolean value)
value - true if a big decimal is returned; false otherwise.
The default value is true.public void setBlockCriteria(int blockCriteria)
blockCriteria - The block criteria.
Valid values include:
public void setBlockSize(int blockSize)
blockSize - The block size in kilobytes.
Valid values include:
public void setCursorSensitivity(java.lang.String cursorSensitivity)
Valid values include:
public void setCursorHold(boolean cursorHold)
cursorHold - true if the cursor is held; false otherwise. The default value is true.public void setDatabaseName(java.lang.String databaseName)
databaseName - The database name or *SYSBAS.public void setDataCompression(boolean compression)
compression - true if data compression is used; false otherwise.public void setDataSourceName(java.lang.String dataSourceName)
dataSourceName - The data source name.public void setDataTruncation(boolean truncation)
truncation - true if data truncation is used; false otherwise.public void setDateFormat(java.lang.String dateFormat)
dateFormat - The date format.
Valid values include:
public void setDateSeparator(java.lang.String dateSeparator)
dateSeparator - The date separator.
Valid values include:
public void setDecimalSeparator(java.lang.String decimalSeparator)
decimalSeparator - The decimal separator.
Valid values include:
public void setDescription(java.lang.String description)
description - The description.public void setSort(java.lang.String sort)
sort - The sort value.
Valid values include:
public void setErrors(java.lang.String errors)
errors - The error message level.
Valid values include: "basic" and "full". The default value is "basic".public void setExtendedDynamic(boolean extendedDynamic)
extendedDynamic - If extended dynamic support is used; false otherwise.
The default value is not to use extended dynamic support.public void setExtendedMetaData(boolean extendedMetaData)
extendedMetaData - True to request extended metadata from the server, false otherwise.
The default value is false.public void setFullOpen(boolean fullOpen)
fullOpen - True to fully open a file (turn off optimizations), false
to allow optimizations. The default value is false.public void setLazyClose(boolean lazyClose)
lazyClose - true to delay closing cursors until subsequent requests; false otherwise.
The default value is false.public void setLibraries(java.lang.String libraries)
libraries - The library list.public void setLobThreshold(int threshold)
threshold - The lob threshold. Valid range is 0-16777216.
The default value is 0.
public void setLoginTimeout(int timeout)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.DataSourcetimeout - The login timeout in seconds.
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter writer)
throws java.sql.SQLException
setLogWriter in interface javax.sql.DataSourcewriter - The log writer; to disable, set to null.
java.sql.SQLException - If a database error occurs.public void setNaming(java.lang.String naming)
naming - The naming convention. Valid values include: "sql" (e.g. schema.table)
and "system" (e.g. schema/table). The default value is "sql".public void setPackage(java.lang.String packageName)
packageName - The base name of the SQL package.public void setPackageAdd(boolean add)
add - If newly prepared statements should be added to the SQL package specified on
the "package" property; false otherwise.
The default value is true.public void setPackageCache(boolean cache)
cache - If caching is used; false otherwise. The default value is false.public void setPackageClear(boolean clear)
clear - If the SQL package are cleared when full; false otherwise.public void setPackageCriteria(java.lang.String packageCriteria)
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".public void setPackageError(java.lang.String packageError)
packageError - The action when SQL errors occur.
Valid values include: "exception", "warning", and "none". The default value is "warning".public void setPackageLibrary(java.lang.String packageLibrary)
packageLibrary - The SQL package library. The default library is "QGPL".public void setPassword(java.lang.String password)
password - The password.public void setPrefetch(boolean prefetch)
prefetch - If prefetch is used; false otherwise.
The default value is to prefectch data.public void setPrompt(boolean prompt)
prompt - true if the user is prompted for signon information; false otherwise.
The default value is false.public void setProxyServer(java.lang.String proxyServer)
proxyServer - The proxy server.public void setRemarks(java.lang.String remarks)
remarks - The text source.
Valid values include: "sql" (SQL object comment) and "system" (OS/400 object description).
The default value is "system".public void setSecondaryUrl(java.lang.String url)
url - The secondary URL.public void setSecure(boolean secure)
secure - true if Secure Socket Layer connection is used; false otherwise.
The default value is false.public void setServerName(java.lang.String serverName)
serverName - The server name.public void setServerTraceCategories(int traceCategories)
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);
traceCategories - level of tracing to start.
Valid values include:
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.
public void setDriver(java.lang.String driver)
Valid values include:
public void setSavePasswordWhenSerialized(boolean savePassword)
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.
savePassword - true if the password is saved; false otherwise.
The default value is falsepublic void setSortLanguage(java.lang.String language)
language - The three-character language id.
The default value is based on the locale.public void setSortTable(java.lang.String table)
table - The qualified sort table name.public void setSortWeight(java.lang.String sortWeight)
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".public void setThreadUsed(boolean threadUsed)
threadUsed - true if a thread is used; false otherwise.
The default value is true.public void setTimeFormat(java.lang.String timeFormat)
timeFormat - The time format.
Valid values include:
public void setTimeSeparator(java.lang.String timeSeparator)
timeSeparator - The time separator.
Valid values include:
public void setTrace(boolean trace)
trace - true if trace message are logged; false otherwise.
The default value is false.public void setTransactionIsolation(java.lang.String transactionIsolation)
public void setTranslateBinary(boolean translate)
translate - true if binary data is translated; false otherwise.
The default value is false.public void setUser(java.lang.String user)
user - The user.public boolean getKeepAlive()
public int getReceiveBufferSize()
public int getSendBufferSize()
public int getSoLinger()
public int getSoTimeout()
public boolean getTcpNoDelay()
public void setKeepAlive(boolean keepAlive)
keepAlive - The keepalive option value.public void setReceiveBufferSize(int size)
size - The socket receive buffer size option value.public void setSendBufferSize(int size)
size - The socket send buffer size option value.public void setSoLinger(int seconds)
seconds - The socket linger option value.public void setSoTimeout(int milliseconds)
milliseconds - The socket timeout option value.public void setTcpNoDelay(boolean noDelay)
noDelay - The socket TCP no delay option value.public int getPackageCCSID()
public void setPackageCCSID(int ccsid)
ccsid - The package CCSID.public int getMinimumDivideScale()
public int getMaximumPrecision()
public int getMaximumScale()
public void setMinimumDivideScale(int scale)
scale - The minimum divide scale.public void setMaximumPrecision(int precision)
precision - The maximum precision.public void setMaximumScale(int scale)
scale - The maximum scale.public java.lang.String getTranslateHex()
Valid values include:
public void setTranslateHex(java.lang.String parseOption)
parseOption - The hex constant parser option.
Valid values include:
public void setQaqqiniLibrary(java.lang.String libraryName)
libraryName - The QAQQINI library name.public java.lang.String getToolboxTraceCategory()
Valid values include:
public void setToolboxTraceCategory(java.lang.String traceCategory)
traceCategory - The category option.
Valid values include:
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||