12.  Microsoft SQL Server

12.1. Known issues with SQL Server

Example 2.12.  Example properties for Microsoft SQLServer

openjpa.ConnectionDriverName: com.microsoft.sqlserver.jdbc.SQLServerDriver
openjpa.ConnectionURL: \
    jdbc:sqlserver://SERVER_NAME:1433;DatabaseName=DB_NAME;selectMethod=cursor;sendStringParametersAsUnicode=false

12.1.  Known issues with SQL Server

  • SQL Server date fields are accurate only to the nearest 3 milliseconds, possibly resulting in precision loss in stored dates.

  • The ConnectionURL must always contain the " selectMethod=cursor " string.

  • Adding sendStringParametersAsUnicode=false to the ConnectionURL may significantly increase performance.

  • The Microsoft SQL Server driver only emulates batch updates. The DataDirect JDBC driver has true support for batch updates, and may result in a significant performance gain.

  • Floats and doubles may lose precision when stored.

  • TEXT columns cannot be used in queries.

  • When using a SQL Server instance that has been configured to be case-sensitive in schema names, you need to set the "schemaCase=preserve" parameter in the openjpa.jdbc.DBDictionary property.