InitializationString
- Last Updated: January 24, 2023
- 1 minute read
- DataDirect Connectors
- JDBC
- Microsoft SQL Server 6.0
- Documentation
Purpose
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
Data source method
public String
getInitializationString()
public void
setInitializationString(String)
Default
None
Data type
String