WebLogic Type 4 JDBC Drivers
The following sections describe how to configure and use the BEA WebLogic Type 4 JDBC Informix driver:
The BEA WebLogic Type 4 JDBC Informix driver (the "Informix driver") supports:
The driver classes for the BEA WebLogic Type 4 JDBC Informix driver are:
XA: weblogic.jdbcx.informix.InformixDataSource
Non-XA: weblogic.jdbc.informix.InformixDriver
Use these driver classes when configuring a JDBC data source in your WebLogic Server domain.
To connect to an Informix database, use the following URL format:
jdbc:bea:informix://dbserver1:1543;informixServer=dbserver1;databaseName=dbname
Table 4-1 lists the JDBC connection properties supported by the Informix driver, and describes each property. You can use these connection properties in a JDBC data source configuration in your WebLogic Server domain. To specify a property, use the following form in the JDBC data source configuration:
property=value
Note: All connection property names are case-insensitive. For example, Password is the same as password.
The code page the driver uses when converting character data. The specified code page overrides the default database code page. All character data retrieved from or written to the database is converted using the specified code page. The value must be a string containing the name of a valid code page supported by your Java Virtual Machine, for example, CodePageOverride=CP950. |
|
The number of times the driver retries connections to a database servers (primary and alternate) until a successful connection is established. Valid values are 0 and any positive integer. If set to 0, the driver does not retry a connection to the list of database servers if a connection is not established on the driver's first pass through the list. |
|
The number of seconds the driver will wait between connection retry attempts when ConnectionRetryCount is set to a positive integer. |
|
The name of the database to which you want to connect. If this property is not specified, a connection is established to the specified server without connecting to a particular database. A connection that is established to the server without connecting to the database allows an application to use CREATE DATABASE and DROP DATABASE SQL statements. These statements require that the driver cannot be connected to a database. An application can connect to the database after the connection is established by executing the DATABASE SQL statement. Refer to your IBM Informix documentation for details on using the CREATE DATABASE, DROP DATABASE, and DATABASE SQL statements. |
|
The name of the Informix database server to which you want to connect. |
|
{-1 | 0 | x}. Determines the amount of memory used by the driver to cache insensitive result set data. If set to -1, the driver caches all insensitive result set data in memory. If the size of the result set exceeds available memory, an OutOfMemoryException is generated. Because the need to write result set data to disk is eliminated, the driver processes the data more efficiently. If set to 0, the driver caches all insensitive result set data in memory, up to a maximum of 2 GB. If the size of the result set data exceeds available memory, the driver pages the result set data to disk. Because result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk. If set to x, where x is a positive integer, the driver caches all insensitive result set data in memory, using this value to set the size (in KB) of the memory buffer for caching insensitive result set data. If the size of the result set data exceeds the buffer size, the driver pages the result set data to disk. Because the result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk. Specifying a buffer size that is a power of 2 results in more efficient memory use. |
|
The maximum time in seconds that attempts to create a database connection will wait. A value of |
|
A case-insensitive password used to connect to your Informix database. A password is required only if security is enabled on your database. If so, contact your system administrator to get your password. |
|
The TCP port on which the database server listens for connections. The default varies depending on operating system. |
|
Specifies either the IP address or the server name (if your network supports named servers) of the primary database server. For example, 122.23.15.12 or InformixServer. |
|
The case-insensitive default user name used to connect to your Informix database. A user name is required only if security is enabled on your database. If so, contact your system administrator to get your user name. |
If anything causes a change to a database table or procedure, such as adding an index, or recompiling the procedure, all existing JDBC PreparedStatements that access it must be re-prepared before they can be used again. This is a limitation of the Informix database management system. WebLogic Server caches, retains, and reuses application PreparedStatements along with pooled connections, so if your application uses prepared statements that access tables or procedures that are dropped and recreated or for which the definition is changed, re-execution of a cached prepared statement will fail once. WebLogic Server will then remove the defunct prepared statement from the cache and replace it when the application asks for the statement again.
To avoid any PreparedStatement failure due to table or procedure changes in the DBMS while WebLogic Server is running, set the Statement Cache Size to 0. WebLogic will make a new PreparedStatement for each request. However, with the statement cache disabled, you will lose the performance benefit of statement caching.
For information about setting the Statement Cache Size, see "Increasing Performance with the Statement Cache" in the Configuring and Managing WebLogic JDBC.
Table 4-2 lists the data types supported by the Informix driver and how they are mapped to the JDBC data types.
See GetTypeInfo for more information about data types.
See SQL Escape Sequences for JDBC for information about the SQL escape sequences supported by the Informix driver.
Informix supports the Read Committed, Read Uncommitted, Repeatable Read, and Serializable isolation levels. The default is Read Committed.
The Informix driver supports scroll-sensitive result sets, scroll-insensitive result sets, and updatable result sets.
Note: When the Informix driver cannot support the requested result set type or concurrency, it automatically downgrades the cursor and generates one or more SQLWarnings with detailed information.
The Informix driver supports parameter metadata only for Insert and Update statements. It does not return parameter metadata for Select statements or for stored procedure arguments.
When searching a Clob value for a string pattern using the Clob.position method, the search pattern must be less than or equal to a maximum value of 4096 bytes. Similarly, when searching a Blob value for a byte pattern using the Blob.position method, the search pattern must be less than or equal to a maximum value of 4096 bytes.
When converting a file to a Blob using the FILETOBLOB feature with the SERVER
keyword and a file that exists on the server, the conversion works properly with a command similar to the following:
st.executeUpdate("INSERT INTO doc_list VALUES (7, FILETOBLOB('c:\\temp\\INSTSRV.EXE', 'SERVER'))");
You cannot use the FILETOBLOB
function with the CLIENT
keyword because the function relies on the Informix client software to handle the data transfer from the client side to the server side. With the WebLogic JDBC Driver for Informix, there is no underlying client software so there is no current implementation to handle this type of data transfer.
The Informix driver supports retrieving the values of auto-generated keys. An auto-generated key returned by the Informix driver is the value of a SERIAL column or a SERIAL8 column.
Statement.execute (String sql, int autoGeneratedKeys)
Statement.executeUpdate (String sql, int autoGeneratedKeys).
Connection.prepareStatement (String sql, int autoGeneratedKeys)
The application fetches the values of generated keys from the driver using the Statement.getGeneratedKeys()
method.