Note: | The BEA WebLogic Type 4 JDBC MS SQL Server driver (the subject of this chapter) replaces the WebLogic jDriver for Microsoft SQL Server, which is deprecated. The new driver offers JDBC 3.0 compliance, support for some JDBC 2.0 extensions, and better performance. BEA recommends that you use the new BEA WebLogic Type 4 JDBC MS SQL Server driver in place of the WebLogic jDriver for Microsoft SQL Server. |
Note: | The first back slash character ( ) in
instance_name is an escape character. |
server_name
is the IP address or hostname of the server. instance_name
is the name of the instance to which you want to connect on the server. Note: | All connection string property names are case-insensitive. For example, Password is the same as password. |
Description | |
---|---|
OPTIONAL | {true | false}. Determines how the driver reports results generated by database triggers (procedures that are stored in the database and executed, or fired, when a table is modified). If set to true, the driver returns all results, including results generated by triggers. Multiple trigger results are returned one at a time. Use the Statement.getMoreResults method to retrieve individual trigger results. Warnings and errors are reported in the results as they are encountered. If set to false, the driver does not report trigger results if the statement is a single Insert, Update, or Delete statement. In this case, the only result that is returned is the update count generated by the statement that was executed (if errors do not occur). Although trigger results are ignored, any errors generated by the trigger are reported. Any warnings generated by the trigger are enqueued. If errors are reported, the update count is not reported. |
CodePageOverride | Specifies 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. If a value is set for the CodePageOverride property and the SendStringParametersAsUnicode property is set to true, the driver ignores the SendStringParametersAsUnicode property and generates a warning. The driver always sends parameters using the code page specified by CodePageOverride if this property is specified. |
OPTIONAL | The number of times the driver retries connections to a database server 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. |
ConnectionRetryDelay | The number of seconds the driver waits before retrying connection attempts when ConnectionRetryCount is set to a positive integer. |
DatabaseName | The name of the database to which you want to connect. |
OPTIONAL | The process ID of the application connecting to Microsoft SQL Server. The value of this property appears in the hostprocess column of the master.dbo.sysprocesses table and may be useful for database administration purposes. |
InsensitiveResultSetBufferSize | {-1 | 0 | x}. Determines the amount of memory used by the driver to cache insensitive result set data. It must have one of the following values: 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. |
NetAddress | The Media Access Control (MAC) address of the network interface card of the application connecting to Microsoft SQL Server. The value of this property appears in the net_address column of the master.dbo.sysprocesses table and may be useful for database administration purposes. |
Password | A case-insensitive password used to connect to your Microsoft SQL Server database. |
OPTIONAL | The TCP port of the primary database server that is listening for connections to the Microsoft SQL Server database. |
ProgramName | The name of the application connecting to Microsoft SQL Server. The value of this property appears in the program_name column of the master.dbo.sysprocesses table and may be useful for database administration purposes. |
SelectMethod | {direct | cursor}. A hint to the driver that determines whether the driver requests a database cursor for Select statements. Performance and behavior of the driver are affected by this property, which is defined as a hint because the driver may not always be able to satisfy the requested method.
|
SendStringParametersAsUnicode | {true | false}. Determines whether string parameters are sent to the Microsoft SQL Server database in Unicode or in the default character encoding of the database. If set to true, string parameters are sent to Microsoft SQL Server in Unicode. If set to false, string parameters are sent in the default encoding, which can improve performance because the server does not need to convert Unicode characters to the default encoding. You should, however, use default encoding only if the parameter string data you specify is the same as the default encoding of the database. If a value is specified for the CodePageOverride property and this property is set to true, this property is ignored and a warning is generated. |
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 SQLServerServer. To connect to a named instance, specify server_name
instance_name for this property, where server_name is the IP address and instance_name is the name of the instance to which you want to connect on the specified server. | |
The case-insensitive user name used to connect to your Microsoft SQL Server database. | |
{true | false}. Determines whether the driver uses server-side cursors when an updatable result set is requested. If set to true, server-side updatable cursors are created when an updatable result set is requested. If set to false, the default updatable result set functionality is used. See Server-Side Updatable Cursors for more information about using server-side updatable cursors. | |
OPTIONAL | The workstation ID, which typically is the network name of the computer on which the application resides. If specified, this value is stored in the hostname column of the master.dbo.sysprocesses table and can be returned by sp_who and the Transact-SQL HOST_NAME function. The value can be useful for database administration purposes. |
XATransactionGroup | The transaction group ID that identifies any transactions initiated by the connection. This ID can be used for distributed transaction cleanup purposes. |
MaxPooledStatements
property is set to 20, the driver caches the last 20 prepared statements created by the application. If the value set for this property is greater than the number of prepared statements used by the application, all prepared statements are cached. ResultSetMetaData.getTableName()
method is called. Because of this, the getTableName()
method may return an empty string for each column in the result set. If you know that your application does not require table name information, this setting provides the best performance. SendStringParametersAsUnicode
to false can improve performance. JDBC Data Type |
---|
BINARY |
BIT |
CHAR |
TIMESTAMP |
DECIMAL |
DECIMAL |
FLOAT |
LONGVARBINARY |
INTEGER |
INTEGER |
DECIMAL |
CHAR |
LONGVARCHAR |
NUMERIC |
NUMERIC |
VARCHAR |
REAL |
TIMESTAMP |
SMALLINT |
SMALLINT |
DECIMAL |
VARCHAR |
LONGVARCHAR |
BINARY |
TINYINT |
TINYINT |
CHAR |
VARBINARY |
VARCHAR |
JDBC Data Type |
---|
BIGINT |
BIGINT |
VARCHAR |
Note: | When the SQL Server driver cannot support the requested result set type or concurrency, it automatically downgrades the cursor and generates one or more SQLWarnings with detailed information. |
UseServerSideUpdatableCursors
property to true. UseServerSideUpdatableCursors
property is set to true and a scroll-insensitive updatable result set is requested, the driver downgrades the request to a scroll-insensitive read-only result set. Similarly, when a scroll-sensitive updatable result set is requested and the table from which the result set was generated does not contain a primary key, the driver downgrades the request to a scroll-sensitive read-only result set. In both cases, a warning is generated. UseServerSideUpdatableCursors=false
), those changes would not be visible. sqljdbc.dll
and instjdbc.sql
files from the WL_HOME
serverlib
directory to the SQL_Server_Root
/bin
directory of the MS SQL Server database server, where WL_HOME
is the directory in which WebLogic server is installed, typically c:beaweblogic81
.Note: | If you are installing stored procedures on a database server with multiple Microsoft SQL Server instances, each running SQL Server instance must be able to locate the sqljdbc.dll file. Therefore the sqljdbc.dll file needs to be anywhere on the global PATH or on the application-specific path. For the application-specific path, place the sqljdbc.dll file into the <drive>:Program FilesMicrosoft SQL ServerMSSQL$<Instance 1 Name>Binn directory for each instance. |
instjdbc.sql
script. The system administrator should back up the master database before running instjdbc.sql
. At a command prompt, use the following syntax to run instjdbc.sql
:instjdbc.sql
. (You copied this script to the SQL_Server_Root
/bin
directory in step 1.) instjdbc.sql
script generates many messages. In general, these messages can be ignored; however, the system administrator should scan the output for any messages that may indicate an execution error. The last message should indicate that instjdbc.sql
ran successfully. The script fails when there is insufficient space available in the master database to store the JDBC XA procedures or to log changes to existing procedures. INSERT INTO foo VALUES (?, ?, ?)
INSERT INTO foo (col1, col2, col3) VALUES (?, ?, ?)
UPDATE foo SET col1=?, col2=?, col3=? WHERE col1 operator? [{AND | OR} col2 operator ?]
operator
is any of the following SQL operators: =, <, >, <=, >=, and <>. ResultSetMetaDataOptions
property to 1, the SQL Server driver performs additional processing to determine the correct table name for each column in the result set when the ResultSetMetaData.getTableName()
method is called. Otherwise, the getTableName()
method may return an empty string for each column in the result set. ResultSetMetaDataOptions
property is set to 1 and the ResultSetMetaData.getTableName()
method is called, the table name information that is returned by the SQL Server driver depends on whether the column in a result set maps to a column in a table in the database. For each column in a result set that maps to a column in a table in the database, the SQL Server driver returns the table name associated with that column. For columns in a result set that do not map to a column in a table (for example, aggregates and literals), the SQL Server driver returns an empty string. ResultSetMetaData.getTableName()
method returns the correct table name for columns in the Select list: ResultSetMetaData.getSchemaName()
and ResultSetMetaData.getCatalogName()
methods are called if the driver can determine that information. For example, for the following statement, the SQL Server driver returns 'test' for the catalog name, 'test1' for the schema name, and 'foo' for the table name: ResultSetMetaData.getTableName()
, ResultSetMetaData.getSchemaName()
, or ResultSetMetaData.getCatalogName()
methods are called. Statement.execute
and Statement.executeUpdate
methods to inform the driver to return the values of auto-generated keys: Statement.execute (String sql, int autoGeneratedKeys)
Statement.executeUpdate (String sql, int autoGeneratedKeys)
Connection.prepareStatement
method to inform the driver to return the values of auto-generated keys:Connection.prepareStatement (String sql, int autoGeneratedKeys)
Statement.getGeneratedKeys
method. © BEA Systems |