9 Microsoft SQL Server Driver : Connection Properties

Connection Properties
This section lists the JDBC connection properties supported by the SQL Server driver and describes each property. The properties have the form:
property=value
You can use these connection properties with either the JDBC Driver Manager or DataDirect Connect Series for JDBC data sources unless otherwise noted.
NOTES:
■
All connection property names are case-insensitive. For example, Password is the same as password. Required properties are noted as such.
■
AccountingInfo
Description
Accounting information to be stored in the database. This value is stored locally and is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the accounting information.
Default
empty string
Data Type
String
See Also
“Using Client Information”
AlternateServers
Description
A list of alternate database servers that is used to failover new or lost connections, depending on the failover method selected. See the FailoverMode property for information about choosing a failover method.
Valid Values
(servername1[:port1][;property=value[;...]][,servername2[:port2]
[;property=value[;...]]]...)
The server name (servername1, servername2, and so on) is required for each alternate server entry. Port number (port1, port2, and so on) and connection properties (property=value) are optional for each alternate server entry. If the port is unspecified, the port number of the primary server is used. If a port number for the primary server is unspecified, a default port number of 1433 is used.
The driver allows only one optional connection property, DatabaseName.
NOTE: If using failover with Microsoft Cluster Server (MSCS), which determines the alternate server for failover instead of the driver, any alternate server specified must be the same as the primary server. For example:
jdbc:datadirect:sqlserver://server1:1433;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server1:1433;DatabaseName=TEST)
Example
The following URL contains alternate server entries for server2 and server3. The alternate server entries contain the optional DatabaseName property.
jdbc:datadirect:sqlserver://server1:1433;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server2:1433;DatabaseName=TEST2,server2:1433;
DatabaseName=TEST3)
Default
None
Data type
String
See Also
“Configuring Failover”
AlwaysReportTriggerResults
Description
Determines how the driver reports results that are generated by database triggers (procedures that are stored in the database and executed, or fired, when a table is modified). For Microsoft SQL Server 2005 and higher, this includes triggers that are fired by Data Definition Language (DDL) events.
Valid Values
true | false
If set to true, the driver returns all results, including results that are generated by triggers. Multiple trigger results are returned sequentially. Use the Statement.getMoreResults() method to return individual trigger results. Warnings and errors are reported in the results as they are encountered.
If set to false, the following behavior occurs:
■
For Microsoft SQL Server 2005 and higher, the driver does not report trigger results if the statement is a single Insert, Update, Delete, Create, Alter, Drop, Grant, Revoke, or Deny statement.
■
For other Microsoft SQL Server databases, the driver does not report trigger results if the statement is a single Insert, Update, or Delete statement.
The only result that is returned is the update count that is generated by the statement that was executed (if errors do not occur). Although trigger results are ignored, any errors that are generated by the trigger are reported. Any warnings that are generated by the trigger are enqueued. If errors are reported, the update count is not reported.
Default
false
Data Type
boolean
ApplicationName
Description
The name of the application to be stored in the database. For Microsoft SQL Server 2000 and higher, this property sets the program_name column in the sysprocesses table in the database. For Microsoft SQL Server 7, this value is stored locally. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the name of the application.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
Alias
ProgramName property
See Also
“Using Client Information”
AuthenticationMethod
Description
Determines which authentication method the driver uses when establishing a connection. If the specified authentication method is not supported by the database server, the connection fails and the driver throws an exception.
Valid Values
auto | kerberos | ntlm | ntlmjava | userIdPassword
If set to auto, the driver uses SQL Server authentication, Kerberos authentication, or NTLM authentication when establishing a connection. The driver selects an authentication method based on a combination of criteria, such as whether the application provides a user ID, the driver is running on a Windows platform, and the driver can load the DLL required for NTLM authentication. See “Using the AuthenticationMethod Property” for more information about using the default value.
If set to kerberos, the driver uses Kerberos authentication. The driver ignores any user ID or password specified. This value is supported only when connecting to Microsoft SQL Server 2000 or higher.
If set to ntlm, the driver uses NTLM authentication if the DLL required for NTLM authentication can be loaded. If the driver cannot load the DLL, the driver throws an exception. The driver ignores any specified user ID or password. This value is supported for Windows clients only.
If set to ntlmjava, the driver uses NTLM authentication, but requires a user ID and password to be specified. This value is supported for Windows and UNIX/Linux clients.
NOTE: If you specify AuthenticationMethod=ntlmjava, you must specify the name of the domain server that administers the database. You can specify the domain server using the Domain property. If the Domain property is not specified, the driver tries to determine the domain server from the User property. If the driver cannot determine the domain server name, it throws an exception.
If set to userIdPassword, the driver uses SQL Server authentication when establishing a connection. If a user ID is not specified, the driver throws an exception.
NOTES:
■
The User property provides the user ID. The Password property provides the password.
■
The values type4, type2, and none are deprecated, but are recognized for backward compatibility. Use the kerberos, ntlm, and userIdPassword value, respectively, instead.
■
Default
userIdPassword
Data Type
String
See Also
“Authentication”
BulkLoadBatchSize
Description
Provides a suggestion to the driver for the number of rows to load to the database at a time when bulk loading data. Performance can be improved by increasing the number of rows the driver loads at a time because fewer network round trips are required. Be aware that increasing the number of rows that are loaded also causes the driver to consume more memory on the client.
NOTES:
■
This property suggests the number of rows regardless of which bulk load method is used: using a DDBulkLoad object or using bulk load for batch inserts.
■
The DDBulkObject.setBatchSize() method overrides the value set by this property. Refer to Chapter 2 “JDBC Extensions” in the DataDirect Connect Series for JDBC Reference for a description of the method.
Valid Values
x
where x is a positive integer that represents a number of rows.
Default
2048
Data Type
long
See Also
“Using DataDirect Bulk Load”
BulkLoadOptions
Description
Enables bulk load protocol options for batch inserts that the driver can take advantage of when EnableBulkLoad is set to a value of true.
Valid Values
This value is the cumulative value of all enabled options. The following list describes the value and the corresponding option that is enabled:
The KeepIdentity option preserves identity values. If unspecified, identity values are ignored in the source and are assigned by the destination.
The TableLock option assigns a table lock for the duration of the bulk copy operation. Other applications cannot update the table until the operation completes. If unspecified, the default bulk locking mechanism specified by the database server is used.
The CheckConstraints option checks integrity constraints while data is being copied. If unspecified, constraints are not checked.
The FireTriggers option causes the database server to fire insert triggers for the rows being inserted into the database. If unspecified, triggers are not fired.
The KeepNulls option preserves null values in the destination table regardless of the settings for default values. If unspecified, null values are replaced by column default values where applicable.
If set to 0, all the options are disabled.
Example
A value of 67 means the KeepIdentity, TableLock, and KeepNulls option are enabled (1 + 2 + 64).
Default
2
Data Type
long
See Also
“Using DataDirect Bulk Load”
ClientHostName
Description
The host name, or workstation ID, of the client machine to be stored in the database. For Microsoft SQL Server 2000 and higher, this property sets the hostname column of the sysprocesses table in the database. For Microsoft SQL Server 7, this value is stored locally. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is the host name of the client machine.
NOTE: Your database may impose character length restrictions on the value. If the value exceeds a restriction, the driver truncates it.
Default
empty string
Data Type
String
Alias
WSID property
See Also
“Using Client Information”
ClientUser
Description
The user ID to be stored in the database. This value is stored locally and is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is a valid user ID.
Default
empty string
Data Type
String
See Also
“Using Client Information”
CodePageOverride
Description
The code page to be used by the driver to convert Character data. The specified code page overrides the default database code page or column collation. All Character data returned from or written to the database is converted using the specified code page.
By default, the driver automatically determines which code page to use to convert Character data. Use this property only if you need to change the driver’s default behavior.
If a value is set for this property and the StringInputParameterType property, the driver ignores the StringInputParameterType property and generates a warning. The driver always sends parameters using the code page that is specified by CodePageOverride, if specified.
Valid Values
string
where string is the name of a valid code page that is supported by your JVM.
Example
CP950
Default
None
Data Type
String
ConnectionRetryCount
Description
The number of times the driver retries connection attempts to the primary database server, and if specified, alternate servers until a successful connection is established.
NOTE: If an application sets a login timeout value (for example, using DataSource.loginTimeout or DriverManager.loginTimeout), and the login timeout expires, the driver ceases connection attempts.
Valid Values
0 | x
where x is a positive integer that represents the number of retries.
If set to 0, the driver does not try to reconnect after the initial unsuccessful attempt.
If set to x, the driver retries connection attempts the specified number of times. If a connection is not established during the retry attempts, the driver returns an exception that is generated by the last database server to which it tried to connect.
NOTE: The ConnectionRetryDelay property specifies the wait interval, in seconds, to occur between retry attempts.
Example
If this property is set to 2 and alternate servers are specified using the AlternateServers property, the driver retries the list of servers (primary and alternate) twice after the initial retry attempt.
Default
5
Data Type
int
See Also
“Configuring Failover”
ConnectionRetryDelay
Description
The number of seconds the driver waits between connection retry attempts when ConnectionRetryCount is set to a positive integer.
Valid Values
0 | x
where x is a number of seconds.
If set to 0, the driver does not delay between retries.
If set to x, the driver waits between connection retry attempts the specified number of seconds.
Example
If ConnectionRetryCount is set to 2, this property is set to 3, and alternate servers are specified using the AlternateServers property, the driver retries the list of servers (primary and alternate) twice after the initial retry attempt. The driver waits 3 seconds between retry attempts.
Default
1 (second)
Data Type
int
See Also
“Configuring Failover”
ConvertNull
Description
Controls how data conversions are handled for null values.
Valid Values
0 | 1
If set to 0, the driver does not perform the data type check if the value of the column is null. This allows null values to be returned even though a conversion between the requested type and the column type is undefined.
If set to 1, the driver checks the data type this is requested against the data type of the table column that stores the data. If a conversion between the requested type and column type is not defined, the driver generates an "unsupported data conversion" exception regardless of the data type of the column value.
Default
1
Data Type
int
Database
Description
An alias for the DatabaseName property.
DatabaseName
Description
The name of the database to which you want to connect.
Valid Values
string
where string is the name of a Microsoft SQL Server database.
Default
None
Data Type
String
Alias
Database property. If both the Database and DatabaseName properties are specified in a connection URL, the last property that is positioned in the connection URL is used. For example, if your application specifies the following connection URL, the value of the Database connection property would be used instead of the value of the DatabaseName connection property.
jdbc:datadirect:sqlserver://server1:1433;DatabaseName=jdbc;Database=acct;
User=test;Password=secret
DateTimeInputParameterType
Description
Specifies how the driver describes the data type for Date/Time/Timestamp input parameters.
This property only applies to connections to Microsoft SQL Server 2008 and higher database servers. For connections to prior versions of Microsoft SQL Server, the driver always describes Date/Time/Timestamp input parameters as datetime.
Valid Values
auto | dateTime | dateTimeOffset
If set to auto, the driver uses the following rules to describe the data type of Date/Time/Timestamp input parameters:
■
■
■
If set to dateTime, the driver describes Date/Time/Timestamp input parameters as datetime.
If set to dateTimeOffset, the driver describes Date/Time/Timestamp input parameters as datetimeoffset.
Default
auto
Data Type
String
DateTimeOutputParameterType
Description
Specifies how the driver describes the data type for Date/Time/Timestamp output parameters.
This property only applies to connections to Microsoft SQL Server 2008 and higher database servers. For connections to prior versions of Microsoft SQL Server, the driver always describes Date/Time/Timestamp output parameters as datetime.
Valid Values
auto | dateTime | dateTimeOffset
If set to auto, the driver uses the following rules to describe the data type of Date/Time/Timestamp output parameters:
■
■
■
If set to dateTime, the driver describes Date/Time/Timestamp output parameters as datetime.
If set to dateTimeOffset, the driver describes Date/Time/Timestamp output parameters as datetimeoffset.
Default
auto
Data Type
String
DescribeParameters
Description
DEPRECATED. Use DescribeInputParameters and DescribeOutputParameters to specify whether the driver attempts to determine, at execute time, how to send input and output parameters to the server based on the database data type.
DescribeInputParameters
Description
Determines whether the driver attempts to determine, at execute time, which data type to use to send input parameters to the database server. Sending parameters as the data type the database expects improves performance and prevents locking issues caused by data type mismatches.
Valid Values
noDescribe | describeIfString | describeIfDateTime | describeAll
If set to noDescribe, the driver does not attempt to describe input parameters and sends String and Date/Time/Timestamp input parameters to the server as specified by the StringInputParameterType and DateTimeInputParameterType properties.
If set to describeIfString, the driver submits a request to the database to describe String input parameters. The driver uses the data types that are returned by the driver to determine whether to describe the String input parameters as nvarchar or varchar. If this operation fails, the driver sends String input parameters to the server as specified by the StringInputParameterType property.
If set to describeIfDateTime, the driver submits a request to the database to describe Date/Time/Timestamp input parameters. The driver uses the data types that are returned by the driver to determine how to describe the Date/Time/Timestamp input parameters. If this operation fails, the driver sends Date/Time/Timestamp input parameters to the server as specified by the DateTimeInputParameterType property.
If set to describeAll, the driver submits a request to the database to describe both String and Date/Time/Timestamp input parameters and uses the data types that are returned by the driver to determine which data type to use to describe the input parameters. If this operation fails, the driver sends String input parameters to the server as specified by the StringInputParameterType property and sends Date/Time/Timestamp input parameters to the server as specified by the DateTimeInputParameterType property.
Default
noDescribe
Data Type
String
DescribeOutputParameters
Description
Determines whether the driver attempts to determine, at execute time, which data type to use to send output parameters to the database server. Sending parameters as the data type the database expects improves performance and prevents locking issues caused by data type mismatches.
Valid Values
noDescribe | describeIfString | describeIfDateTime | describeAll
If set to noDescribe, the driver does not attempt to describe output parameters and sends String and Date/Time/Timestamp output parameters to the server as specified by the StringOutputParameterType and DateTimeOutputParameterType properties.
If set to describeIfString, the driver submits a request to the database to describe String output parameters. The driver uses the data types that are returned by the driver to determine whether to describe the String output parameters as NVARCHAR or VARCHAR. If this operation fails, the driver sends String output parameters to the server as specified by the StringOutputParameterType property.
If set to describeIfDateTime, the driver submits a request to the database to describe Date/Time/Timestamp output parameters. The driver uses the data types that are returned by the driver to determine how to describe the Date/Time/Timestamp output parameters. If this operation fails, the driver sends Date/Time/Timestamp output parameters to the server as specified by the DateTimeOutputParameterType property.
If set to describeAll, the driver submits a request to the database to describe both String and Date/Time/Timestamp output parameters and uses the data types that are returned by the driver to determine which data type to use to describe the output parameters. If this operation fails, the driver sends String output parameters to the server as specified by the StringOutputParameterType property and sends Date/Time/Timestamp output parameters to the server as specified by the DateTimeOutputParameterType property.
Default
noDescribe
Data Type
String
Domain
Description
Specifies the name of the domain server that administers the database. Set this property only if you are using NTLM authentication (AuthenticationMethod=ntlmjava). If the Domain property is unspecified, the driver tries to determine the domain server name from the User property.
Valid Values
string
where string is the name of the domain server.
Default
None
Data Type
String
See Also
“Authentication”
EnableBulkLoad
Description
Specifies whether the driver uses the native bulk load protocols in the database instead of the batch mechanism for batch inserts. Bulk load bypasses the data parsing that is usually done by the database, providing an additional performance gain over batch operations. This property allows existing applications with batch inserts to take advantage of bulk load without requiring changes to the application code.
Valid Values
true | false
If set to true, the driver uses the native bulk load protocols for batch inserts.
If set to false, the driver uses the batch mechanism for batch inserts.
Default
false
Data Type
boolean
See Also
“Using DataDirect Bulk Load”
“Performance Considerations”
EnableCancelTimeout
Description
Determines whether a cancel request that is sent by the driver as the result of a query timing out is subject to the same query timeout value as the statement it cancels.
Valid Values
true | false
If set to true, the cancel request times out using the same timeout value, in seconds, that is set for the statement it cancels. For example, if your application calls Statement.setQueryTimeout(5) on a statement and that statement is cancelled because its timeout value was exceeded, the driver sends a cancel request that also will time out if its execution exceeds 5 seconds. If the cancel request times out, because the server is down, for example, the driver throws an exception indicating that the cancel request was timed out and the connection is no longer valid.
If set to false, the cancel request does not time out.
Default
false
Data Type
boolean
EncryptionMethod
Description
Determines whether data is encrypted and decrypted when it is transmitted over the network between the driver and database server.
NOTE: Connection hangs can occur when the driver is configured for SSL and the database server does not support SSL. You may want to set a login timeout using the LoginTimeout property to avoid problems when connecting to a server that does not support SSL.
Valid Values
noEncryption | SSL | requestSSL | loginSSL
If set to noEncryption, data is not encrypted or decrypted.
If set to SSL, data is encrypted using SSL. If the database server does not support SSL, the connection fails and the driver throws an exception.
If set to requestSSL, the login request and data is encrypted using SSL. If the database server does not support SSL, the driver establishes an unencrypted connection.
If set to loginSSL, the login request is encrypted using SSL. Data is encrypted using SSL If the database server is configured to require SSL. If the database server does not require SSL, data is not encrypted and only the login request is encrypted.
If SSL is enabled, the following properties also apply:
HostNameInCertificate
TrustStore
TrustStorePassword
ValidateServerCertificate
NOTE: If SSL is enabled, the driver communicates with database protocol packets that are set by the server’s default packet size. Any value set by the PacketSize property is ignored.
Default
noEncryption
Data Type
String
See Also
“Data Encryption”
“Performance Considerations”
FailoverGranularity
Description
Determines whether the driver fails the entire failover process or continues with the process if exceptions occur while trying to reestablish a lost connection. This property is ignored if FailoverMode=connect.
Valid Values
nonAtomic | atomic | atomicWithRepositioning
If set to nonAtomic, the driver continues with the failover process and posts any exceptions on the statement on which they occur.
If set to atomic, the driver fails the entire failover process if an exception is generated as the result of restoring the state of the connection. If an exception is generated as a result of restoring the state of work in progress, the driver continues with the failover process, but generates an exception warning that the Select statement must be reissued.
If set to atomicWithRepositioning, the driver fails the entire failover process if any exception is generated as the result of restoring the state of the connection or the state of work in progress.
Default
nonAtomic
Data Type
String
See Also
“Configuring Failover”
FailoverMode
Description
Specifies the type of failover method the driver uses.
Valid Values
connect | extended | select
If set to connect, the driver provides failover protection for new connections only.
If set to extended, the driver provides failover protection for new and lost connections, but not any work in progress.
If set to select, the driver provides failover protection for new and lost connections. In addition, it preserves the state of work performed by the last Select statement executed on the Statement object.
NOTES:
■
The AlternateServers property specifies one or multiple alternate servers for failover and is required for all failover methods. To turn off failover, do not specify a value for the AlternateServers property.
■
The FailoverGranularity property determines which action the driver takes if exceptions occur during the failover process.
■
The FailoverPreconnect property specifies whether the driver tries to connect to multiple database servers (primary and alternate) at the same time.
Default
connect
Data Type
String
See Also
“Configuring Failover”
FailoverPreconnect
Description
Specifies whether the driver tries to connect to the primary and an alternate server at the same time. This property is ignored if FailoverMode=connect.
Valid Values
true | false
If set to true, the driver tries to connect to the primary and an alternate server at the same time. This can be useful if your application is time-sensitive and cannot absorb the wait for the failover connection to succeed.
If set to false, the driver tries to connect to an alternate server only when failover is caused by an unsuccessful connection attempt or a lost connection. This value provides the best performance, but your application typically experiences a short wait while the failover connection is attempted.
NOTE: The AlternateServers property specifies one or multiple alternate servers for failover.
Default
false
Data Type
boolean
See Also
“Configuring Failover”
FetchTSWTZAsTimestamp
Description
Determines whether column values with the datetimeoffset data type are returned as a JDBC VARCHAR or TIMESTAMP data type.
This property only applies to connections to Microsoft SQL Server 2008.
Valid Values
true | false
If set to true, column values with the datetimeoffset data type are returned as a JDBC TIMESTAMP data type.
If set to false, column values with the datetimeoffset data type are returned as a JDBC VARCHAR data type.
Default
false
Data Type
boolean
HostNameInCertificate
Description
Specifies a host name for certificate validation when SSL encryption is enabled (using the EncryptionMethod property) and validation is enabled (ValidateServerCertificate=true). This property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server that the driver is connecting to is the server that was requested.
NOTES:
■
■
If SSL encryption and validation is enabled and this property is unspecified, the driver uses the server name that is specified in the connection URL or data source of the connection to validate the certificate.
Valid Values
host_name | #SERVERNAME#
where host_name is a valid host name.
If host_name is specified, the driver compares the specified host name to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist in the SubjectAlternativeName or if the certificate does not have a SubjectAlternativeName, the driver compares the host name with the Common Name (CN) part of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception.
If #SERVERNAME# is specified, the driver compares the server name that is specified in the connection URL or data source of the connection to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist in the SubjectAlternativeName or if the certificate does not have a SubjectAlternativeName, the driver compares the host name to the CN part of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception. If multiple CN parts are present, the driver validates the host name against each CN part. If any one validation succeeds, a connection is established.
Default
empty string
Data Type
String
HostProcess
Description
An alias for the ProgramID property.
ImportStatementPool
Description
Specifies the path and file name of the file to be used to load the contents of the statement pool. When this property is specified, statements are imported into the statement pool from the specified file.
If the driver cannot locate the specified file when establishing the connection, the connection fails and the driver throws an exception.
Valid Values
string
where string is the path and file name of the file to be used to load the contents of the statement pool.
Default
empty string
Data Type
String
See Also
“Using Statement Pooling”
Chapter 10 “Statement Pool Monitor” in the DataDirect Connect Series for JDBC Reference
“Performance Considerations”
InitializationString
Description
Specifies one or multiple SQL commands to be executed by the driver after it has established the connection to the database and has performed all initialization for the connection. If the execution of a SQL command fails, the connection attempt also fails and the driver throws an exception indicating which SQL command or commands failed.
Valid Values
string
where string is one or multiple SQL commands.
Multiple commands must be separated by semicolons. In addition, if this property is specified in a connection URL, the entire value must be enclosed in parentheses when multiple commands are specified.
Example
The following connection URL sets the handling of null values to the Microsoft SQL Server default and allows delimited identifiers:
jdbc:datadirect:sqlserver://server1:1433;InitializationString=
(set ANSI_NULLS off;set QUOTED_IDENTIFIER on);DatabaseName=test
Default
None
Data Type
String
InsensitiveResultSetBufferSize
Description
Determines the amount of memory used by the driver to cache insensitive result set data.
Valid Values
-1 | 0 | x
where x is a positive integer that represents the size of the memory buffer.
If set to -1, the driver caches insensitive result set data in memory. If the size of the result set exceeds available memory, an OutOfMemoryException is generated. With no need to write result set data to disk, the driver processes the data efficiently.
If set to 0, the driver caches 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, the driver caches insensitive result set data in memory and uses 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 available memory, 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 efficient memory use.
Default
2048
Data Type
int
See Also
“Performance Considerations”
JavaDoubleToString
Description
Determines which algorithm the driver uses when converting a double or float value to a string value. By default, the driver uses its own internal conversion algorithm, which improves performance.
Valid Values
true | false
If set to true, the driver uses the JVM algorithm when converting a double or float value to a string value. If your application cannot accept rounding differences and you are willing to sacrifice performance, set this value to true to use the JVM conversion algorithm.
If set to false, the driver uses its own internal algorithm when converting a double or float value to a string value. This value improves performance, but slight rounding differences within the allowable error of the double and float data types can occur when compared to the same conversion using the JVM algorithm.
Default
false
Data Type
boolean
JDBCBehavior
Description
Determines how the driver describes database data types that map to the following JDBC 4.0 data types: NCHAR, NVARCHAR, NLONGVARCHAR, NCLOB, and SQLXML.
This property is applicable only when the application is using Java SE 6 or higher.
Valid Values
0 | 1
If set to 0, the driver describes the data types as JDBC 4.0 data types when using Java SE 6 or higher.
If set to 1, the driver describes the data types using JDBC 3.0-equivalent data types, regardless of JVM. This allows your application to continue using JDBC 3.0 types in a Java SE 6 or higher environment. Additionally, the PROCEDURE_NAME column contains procedure name qualifiers. For example, for the fully qualified procedure named 1.sp_productadd, the driver would return sp_productadd;1.
Default
1
Data Type
int
LoadBalancing
Description
Determines whether the driver uses client load balancing in its attempts to connect to the database servers (primary and alternate). You can specify one or multiple alternate servers by setting the AlternateServers property.
Valid Values
true | false
If set to true, the driver uses client load balancing and attempts to connect to the database servers (primary and alternate) in random order. The driver randomly selects from the list of primary and alternate servers which server to connect to first. If that connection fails, the driver again randomly selects from this list of servers until all servers in the list have been tried or a connection is successfully established.
If set to false, the driver does not use client load balancing and connects to each server based on their sequential order (primary server first, then, alternate servers in the order they are specified).
Default
false
Data Type
boolean
See Also
“Configuring Failover”
LoadLibraryPath
Description
Specifies the directory for the DLL for NTLM authentication on Windows clients when AuthenticationMethod=ntlm. The driver looks for the DLL in the specified directory.
NOTE: When you install the driver, the NTLM authentication DLLs are installed in the install_dir/lib subdirectory, where install_dir is the product installation directory.
Valid Values
string
where string is the fully qualified path of the directory that contains the DLL for NTLM authentication.
If unspecified, the driver looks for the DLL in a directory on the Windows system path defined by the PATH environment variable.
If set to string, the driver looks in the specified directory for the DLL. Use this value if you install the driver in a directory that is not on the Windows system path.
Example
If you install the driver in a directory named "DataDirect" that is not on the Windows system path, use this property to specify the directory containing the NTLM authentication DLL.
jdbc:datadirect:sqlserver://server3:1433;DatabaseName=test;
LoadLibraryPath=C:\DataDirect\lib;User=test;Password=secret
Default
None
Data Type
String
See Also
“Configuring NTLM Authentication”
LoginTimeout
Description
The amount of time, in seconds, that the driver waits for a connection to be established before timing out the connection request.
Valid Values
0 | x
where x is a number of seconds.
If set to 0, the driver does not time out a connection request.
If set to x, the driver waits for the specified number of seconds before returning control to the application and throwing a timeout exception.
Default
0
Data Type
int
LongDataCacheSize
Description
Determines whether the driver caches long data (images, pictures, long text, binary data, or XML data) in result sets. To improve performance, you can disable long data caching if your application retrieves columns in the order in which they are defined in the result set.
Valid Values
-1 | 0 | x
where x is a positive integer that represents the size of the memory buffer.
If set to -1, the driver does not cache long data in result sets. It is cached on the server. Use this value only if your application retrieves columns in the order in which they are defined in the result set.
If set to 0, the driver caches long data in result sets in memory. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
If set to x, the driver caches long data in result sets in memory and uses this value to set the size (in KB) of the memory buffer for caching result set data. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
Default
2048
Data Type
int
See Also
“Performance Considerations”
MaxPooledStatements
Description
The maximum number of pooled prepared statements for this connection. Setting MaxPooledStatements to an integer greater than zero (0) enables the driver’s internal prepared statement pooling, which is useful when the driver is not running from within an application server or another application that provides its own prepared statement pooling.
Valid Values
0 | x
where x is a positive integer that represents a number of prepared statements.
If set to 0, the driver’s internal prepared statement pooling is not enabled.
If set to x, the driver enables the DataDirect Statement Pool Monitor and uses the specified value to cache a certain number of prepared statements that are created by an application. For example, if the value of this property is set to 20, the driver caches the last 20 prepared statements that are created by the application. If the value set for this property is greater than the number of prepared statements that are used by the application, all prepared statements created by the application are cached. Because CallableStatement is a sub-class of PreparedStatement, CallableStatements also are cached.
Default
0
Data Type
int
Alias
MaxStatements property
See Also
“Using Statement Pooling”
Chapter 10 “Statement Pool Monitor” in the DataDirect Connect Series for JDBC Reference
“Performance Considerations”
MaxStatements
Description
An alias for the MaxPooledStatements property.
NetAddress
Description
The Media Access Control (MAC) address of the network interface card of the application connecting to Microsoft SQL Server. The value of this property may be useful for database administration purposes. This value is stored in the net_address column of the:
■
■
Microsoft SQL Server 7 does not store this value.
Valid Values
string
where string is a maximum of 12 alphanumeric characters.
Default
000000000000
Data Type
String
PacketSize
Description
Determines the number of bytes for each database protocol packet that is transferred from the database server to the client machine (Microsoft SQL Server refers to this packet as a network packet).
Adjusting the packet size can improve performance. The optimal value depends on the typical size of data that is inserted, updated, or returned by the application and the environment in which it is running. Typically, larger packet sizes work better for large amounts of data. For example, if an application regularly returns character values that are 10,000 characters in length, using a value of 32 (16 KB) typically results in improved performance.
NOTE: If SSL encryption is enabled using the EncryptionMethod property, any value set for the PacketSize property is ignored.
Valid Values
-1 | 0 | x
where x is an integer from 1 to 128 that represents a number of bytes.
If set to -1, the driver uses the maximum packet size that the database server accepts.
If set to 0, the driver uses the default packet size configured on the database server.
If set to x, the driver uses a packet size that is calculated using the specified value multiplied by 512.
NOTE: If your application sends queries that only retrieve small result sets, you may want to use a packet size that is smaller than the maximum packet size that is configured on the database server. If a result set that contains only one or two rows of data does not completely fill a larger packet, performance will not improve by setting the value to the maximum packet size.
Example
If PacketSize=8, the packet size is set to 8 * 512 bytes (4096 bytes).
Default
-1
Data Type
int
See Also
“Performance Considerations”
Password
Description
A password that is used to connect to your Microsoft SQL Server database. A password is required if SQL Server authentication is enabled on your database. Contact your system administrator to obtain your password.
Valid Values
string
where string is a valid password. The password is case-insensitive.
Default
None
Data Type
String
PortNumber
Description
The TCP port of the primary database server that is listening for connections to the Microsoft SQL Server database.
This property is supported only for data source connections.
Valid Values
port
where port is the port number.
Default
1433
Data Type
int
ProgramID
Description
The driver name and version information on the client to be stored in the database. For Microsoft SQL Server 2000 and higher, this property sets the hostprocess column in the sysprocesses table. For Microsoft SQL Server 7, this value is stored locally. This value is used for database administration/monitoring purposes.
NOTE: You can set this information using alternate methods. See “Using Client Information” for details.
Valid Values
string
where string is a value that identifies the product and version of the driver on the client.
Example
DDJ04200
Default
empty string
Data Type
String
Alias
HostProcess property
See Also
“Using Client Information”
ProgramName
Description
An alias for the ApplicationName property.
QueryTimeout
Description
Sets the default query timeout (in seconds) for all statements that are created by a connection.
Valid Values
-1 | 0 | x
where x is a number of seconds.
If set to -1, the query timeout functionality is disabled. The driver silently ignores calls to the Statement.setQueryTimeout() method.
If set to 0, the default query timeout is infinite (the query does not time out).
If set to x, the driver uses the value as the default timeout for any statement that is created by the connection. To override the default timeout value set by this connection option, call the Statement.setQueryTimeout() method to set a timeout value for a particular statement.
Default
0
Data Type
int
ReceiveStringParameterType
Description
DEPRECATED. Use the DescribeOutputParameters property to specify how the driver describes String output parameters for stored procedures to the database.
ResultSetMetaDataOptions
Description
Determines whether the driver returns table name information in the ResultSet metadata for Select statements.
Valid Values
0 | 1
If set to 0 and the ResultSetMetaData.getTableName() method is called, the driver does not perform additional processing to determine the correct table name for each column in the result set. The getTableName() method may return an empty string for each column in the result set.
If set to 1 and the ResultSetMetaData.getTableName() method is called, the driver performs additional processing to determine the correct table name for each column in the result set. The driver returns schema name and catalog name information when the ResultSetMetaData.getSchemaName() and ResultSetMetaData.getCatalogName() methods are called if the driver can determine that information.
Default
0
Data Type
int
See Also
“Performance Considerations”
SelectMethod
Description
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.
Valid Values
direct | cursor
If set to direct, the database server sends the complete result set in a single response to the driver when responding to a query. A server-side database cursor is not created if the requested result set type is a forward-only result set. Typically, responses are not cached by the driver. Using this method, the driver must process the entire response to a query before another query is submitted. If another query is submitted (using a different statement on the same connection, for example), the driver caches the response to the first query before submitting the second query. Typically, the direct method performs better than the cursor method.
If set to cursor, a server-side cursor is requested. When returning forward-only result sets, the rows are returned from the server in blocks. The setFetchSize() method can be used to control the number of rows that are returned for each request when forward-only result sets are returned. Performance tests show that, when returning forward-only result sets, the value of Statement.setFetchSize() significantly impacts performance. There is no simple rule for determining the setFetchSize() value that you should use. We recommend that you experiment with different setFetchSize() values to determine which value gives the best performance for your application. The cursor method is useful for queries that produce a large amount of data, particularly if multiple open result sets are used.
Default
direct
Data Type
String
See Also
“Performance Considerations”
SendStringParametersAsUnicode
Description
DEPRECATED. Use StringInputParameterType and StringOutputParameterType to specify the data type the driver uses to send String input and output parameters to the database.
ServerName
Description
Specifies either the IP address in IPv4 or IPv6 format, or the server name (if your network supports named servers) of the primary database server. See “Using IP Addresses” for more information about using IP addresses.
This property is supported only for data source connections.
Valid Values
string
where string is a valid IP address or server name.
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.
Example
122.23.15.12 or SQLServerServer
Default
None
Data Type
String
See Also
“Connecting to Named Instances”
SnapshotSerializable
Description
For Microsoft SQL Server 2005 and higher only. Allows your application to use Snapshot Isolation for connections.
This property is useful for applications that have the Serializable isolation level set. Using the SnapshotSerializable property allows you to use Snapshot Isolation with no or minimum code changes. If you are developing a new application, you may find that using the constant TRANSACTION_SNAPSHOT is a better choice.
Valid Values
true | false
If set to true and your application has the transaction isolation level set to Serializable, the application uses Snapshot Isolation for connections.
NOTE: To use Snapshot Isolation, your database also must be configured for Snapshot Isolation.
If set to false and your application has the transaction isolation level set to Serializable, the application uses the Serializable isolation level.
Default
false
Data Type
boolean
See Also
“Isolation Levels”
“Performance Considerations”
SpyAttributes
Description
Enables DataDirect Spy to log detailed information about calls issued by the driver on behalf of the application. DataDirect Spy is not enabled by default.
Valid Values
(spy_attribute[;spy_attribute]...)
where spy_attribute is any valid DataDirect Spy attribute. Refer to Chapter 8 “Tracking JDBC Calls with DataDirect Spy™” in the DataDirect Connect Series for JDBC Reference for a list of supported attributes.
NOTE: If coding a path on Windows to the log file in a Java string, the backslash character (\) must be preceded by the Java escape character, a backslash. For example: log=(file)C:\\temp\\spy.log.
Example
The following value instructs the driver to log all JDBC activity to a file using a maximum of 80 characters for each line.
(log=(file)/tmp/spy.log;linelimit=80)
Default
None
Data Type
String
StringInputParameterType
Description
Determines whether the driver sends String input parameters to the database in Unicode or in the default character encoding of the database.
Valid Values
nvarchar | varchar
If set to nvarchar, the driver sends String input parameters to the database in Unicode.
NOTE: If a value is specified for the CodePageOverride property and this property is set to nvarchar, this property is ignored and a warning is generated.
If set to varchar, the driver sends String input parameters to the database in the default character encoding of the database. This value can improve performance because the server does not need to convert Unicode characters to the default encoding.
Default
nvarchar
Data Type
String
See Also
“Performance Considerations”
StringOutputParameterType
Description
Determines whether the driver sends String output parameters to the database server in Unicode or in the default character encoding of the database.
Valid Values
nvarchar | varchar
If set to nvarchar, the driver sends String output parameters to the database as nvarchar(4000). Use this value when all output parameters that are returned in the connection are nchar or nvarchar. If the output parameters are char or varchar, the driver returns the output parameter value, but the returned value is limited to 4000 characters.
If set to varchar, the driver sends String output parameters to the database as varchar(8000). Use this value if all output parameters that are returned in the connection are char or varchar. If an output parameter is nchar or nvarchar, the value may not be returned correctly (for example, if the returned value uses a code page other than the default encoding).
Default
nvarchar
Data Type
String
See Also
“Performance Considerations”
SuppressConnectionWarnings
Description
Determines whether the driver suppresses "changed database" and "changed language" warnings when connecting to the database server.
Valid Values
true | false
If set to true, warnings are suppressed.
If set to false, warnings are not suppressed.
Default
false
Data Type
boolean
TransactionMode
Description
Controls how the driver delimits the start of a local transaction.
Valid Values
implicit | explicit
If set to implicit, the driver uses implicit transaction mode. This means that Microsoft SQL Server, not the driver, automatically starts a transaction when a transactionable statement is executed. Typically, implicit transaction mode is more efficient than explicit transaction mode because the driver does not have to send commands to start a transaction and a transaction is not started until it is needed. When TRUNCATE TABLE statements are used with implicit transaction mode, Microsoft SQL Server may roll back the transaction if an error occurs. If this occurs, use the explicit value for this property.
If set to explicit, the driver uses explicit transaction mode. This means that the driver, not Microsoft SQL Server, starts a new transaction if the previous transaction was committed or rolled back.
Default
implicit
Data Type
String
TruncateFractionalSeconds
Description
Determines whether the driver truncates timestamp values to three fractional seconds. For example, a value of the datetime2 data type can have a maximum of seven fractional seconds.
Valid Values
true | false
If set to true, the driver truncates all timestamp values to three fractional seconds.
If set to false, the driver does not truncate fractional seconds.
Default
true
Data Type
boolean
TrustStore
Description
Specifies the directory of the truststore file to be used when SSL is enabled (using the EncryptionMethod property) and server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the directory of the truststore file that is specified by the javax.net.ssl.trustStore Java system property. If this property is not specified, the truststore directory is specified by the javax.net.ssl.trustStore Java system property.
This property is ignored if ValidateServerCertificate=false.
Valid Values
string
where string is the directory of the truststore file.
Default
None
Data Type
String
TrustStorePassword
Description
Specifies the password that is used to access the truststore file when SSL is enabled (using the EncryptionMethod property) and server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the password of the truststore file that is specified by the javax.net.ssl.trustStorePassword Java system property. If this property is not specified, the truststore password is specified by the javax.net.ssl.trustStorePassword Java system property.
This property is ignored if ValidateServerCertificate=false.
Valid Values
string
where string is a valid password for the truststore file.
Default
None
Data Type
String
User
Description
The user name that is used to connect to the Microsoft SQL Server database. A user name is required only if SQL Server authentication is enabled on your database. Contact your system administrator to obtain your user name.
Valid Values
[domain_name\]user_name
where:
domain_name is the name of a valid domain server. The name is case-insensitive and optional. If specified, you must separate the domain name from the user name by a backward slash (\).
NOTE: Only set the domain server name if AuthenticationMethod=ntlmjava.
user_name is a valid user name. It is case-insensitive.
Example
Smith or DOMAIN1\Smith
Default
None
Data Type
String
UseServerSideUpdatableCursors
Description
Determines whether the driver uses server-side cursors when an updatable result set is requested.
Valid Values
true | false
If set to true, server-side updatable cursors are created when an updatable result set is requested.
If set to false, the client-side updatable cursors are created when an updatable result set is requested.
Default
false
Data Type
boolean
See Also
“Server-Side Updatable Cursors”
“Performance Considerations”
ValidateServerCertificate
Description
Determines whether the driver validates the certificate that is sent by the database server when SSL encryption is enabled (EncryptionMethod=SSL). When using SSL server authentication, any certificate that is sent by the server must be issued by a trusted Certificate Authority (CA). Allowing the driver to trust any certificate that is returned from the server even if the issuer is not a trusted CA is useful in test environments because it eliminates the need to specify truststore information on each client in the test environment.
Valid Values
true | false
If set to true, the driver validates the certificate that is sent by the database server. Any certificate from the server must be issued by a trusted CA in the truststore file. If the HostNameInCertificate property is specified, the driver also validates the certificate using a host name. The HostNameInCertificate property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the driver is connecting to is the server that was requested.
If set to false, the driver does not validate the certificate that is sent by the database server. The driver ignores any truststore information that is specified by the TrustStore and TrustStorePassword properties or Java system properties.
NOTE: Truststore information is specified using the TrustStore and TrustStorePassword properties or by using Java system properties.
Default
true
Data Type
boolean
WSID
Description
An alias for the ClientHostName property.
XATransactionGroup
Description
The transaction group ID that identifies any distributed transactions that are initiated by the connection. This ID can be used for distributed transaction cleanup purposes.
You can use the XAResource.recover method to roll back any transactions left in an unprepared state. When you call XAResource.recover, any unprepared transactions that match the ID on the connection used to call XAResource.recover are rolled back.
Valid Values
string
where string is a valid transaction group ID.
Example
If you specify XATransactionGroup=ACCT200 and call XAResource.recover on the same connection, any transactions that are left in an unprepared state identified by the transaction group ID of ACCT200 are rolled back.
Default
None
Data Type
String
See Also
“Distributed Transaction Cleanup”
XMLDescribeType
Description
Determines whether the driver maps XML data to the LONGVARCHAR or LONGVARBINARY data type.
Valid Values
longvarchar | longvarbinary
If set to longvarchar, the driver maps XML data to the LONGVARCHAR data type.
If set to longvarbinary, the driver maps XML data to the LONGVARBINARY data type.
Default
None
Data Type
String
See Also
“Returning and Inserting/Updating XML Data”