JDBC URL format for SQL Server

In database configuration file database-config.xml, the JDBC URL for SQL Server uses the following format:

<dbcp-connection-pool jdbc-url="jdbc:sqlserver://serverName[:port];
      databaseName=pc;user=pcUser;password=password
      [;applicationName=applicationName]"/>

The example code shows optional parameters in brackets.

If your SQL Server instance listens on the default port, 1433, you can omit the port and preceding colon from the JDBC URL. However, Microsoft recommends that you always specify the port value for security reasons. If you specify the port number, the JDBC driver connects directly to SQL Server and does not make a request to sqlbrowser.exe. If your SQL Server instance is listening to a different port than the default 1433, specify that port number in the JDBC URL.

You can include an applicationName property on the JDBC URL connection string. If you set this value, the server logs and Activity Monitor include it in the thread identification information. If you do not specify an applicationName, the PolicyCenter server creates one by concatenating pc, followed by the application version, including build number. Finally, if you defined the SQL Server ADDL_CONN_DESCR system property, PolicyCenter appends this value to the generated applicationName value.

PolicyCenter requires that the selectMethod on the JDBC URL connection be set to direct. This is the default value, so you do not need to include this value in your JDBC URL. If you include selectMethod and set it to cursor, the server does not start.

PolicyCenter defaults the value of the sendStringParametersAsUnicode property to be the correct, appropriate value in the SQL Server JDBC URL connection. PolicyCenter does not override an existing value. If you set sendStringParametersAsUnicode in database-config.xml, the server will validate the value to be correct.