Microsoft SQL Server

The exact configuration settings for connecting to MS SQL server depend on the JDBC driver you are using. We do not recommend using the JDBC-ODBC bridge with MS SQL Server.

This is the link where you can find all needed information and downloads for MSQL database:

http://www.microsoft.com/sql/default.asp

JTurbo JDBC driver

We certified the JTurbo 2.0 JDBC driver, and the configuration settings for this are:

# JTurbo 2.0 JDBC Driver for MS SQL server
DatabaseManager.Databases [] = "my_db"
DatabaseManager.DefaultDatabase = "my_db"
DatabaseManager.DB.my_db.ClassType = "MSQL"
DatabaseManager.DB.my_db.JdbcDriver = "com.ashna.jturbo.driver.Driver"
DatabaseManager.DB.my_db.Connection.Url = "jdbc:JTurbo://<host>:<port>/<dbName>"
DatabaseManager.DB.my_db.Connection.User = "<user_name>"
DatabaseManager.DB.my_db.Connection.Password = "<password>"

If you are using another JDBC driver, you need to determine the driver package, for the DatabaseManager.DB.my_db.JdbcDriver setting, and connection string, for DatabaseManager.DB.my_db.Connection.Url setting.

jTDS JDBC driver

jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000 and 2005) and Sybase (10, 11, 12).

We certified the jTDS JDBC Driver 1.1, and the configuration settings for this are:

# jTDS JDBC Driver 1.1 for MS SQL server
DatabaseManager.Databases [] = "my_db"
DatabaseManager.DefaultDatabase = "my_db"
DatabaseManager.DB.my_db.ClassType = "MSQL"
DatabaseManager.DB.my_db.JdbcDriver = "net.sourceforge.jtds.jdbc.Driver"
DatabaseManager.DB.my_db.Connection.Url 
            ="jdbc:jtds:sqlserver://<hostname>:<port>/<databaseName>;
               tds=8.0;lastupdatecount=true"
DatabaseManager.DB.my_db.Connection.User = "<user_name>"
DatabaseManager.DB.my_db.Connection.Password = "<password>"

http://jtds.sourceforge.net/

MS-JDBC driver

Configuration settings example for MS-JDBC driver are:

DatabaseManager.DB.my_db.JdbcDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver"
# NOTE: substitute your server's IP address (hostname)
# Substitute the port your DB is listening on for (default: 1433) 
DatabaseManager.DB.my_db.Connection.Url 
          ="jdbc:microsoft:sqlserver://<hostname>:<port>;
             DatabaseName= <databaseName>;SelectMethod=cursor "
DatabaseManager.DB.my_db.Connection.User = "<user_name>"
DatabaseManager.DB.my_db.Connection.Password = "<password>"

Configuration settings example for Microsoft SQL Server 2005 JDBC Driver driver are:

DatabaseManager.DB.my_db.JdbcDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
# NOTE: substitute your server's IP address (hostname)
# Substitute the port your DB is listening on for (default: 1433) 
DatabaseManager.DB.my_db.Connection.Url 
          ="jdbc:sqlserver://<hostname>:<port>;
             DatabaseName= <databaseName>;SelectMethod=cursor "
DatabaseManager.DB.my_db.Connection.User = "<user_name>"
DatabaseManager.DB.my_db.Connection.Password = "<password>"

If you are using another JDBC driver, you need to determine the driver package, for the DatabaseManager.DB.my_db.JdbcDriver setting, and connection string, for DatabaseManager.DB.my_db.Connection.Url setting.

Connection Parameters:

SendStringParametersAsUnicode

Determines whether string parameters are sent to the SQL Server database in Unicode or in the default character encoding of the database. True means that string parameters are sent to SQL Server in Unicode. False means that they 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 that you specify is consistent with the default encoding of the database. Default value is true.

SelectMethod

Determines whether database cursors are used for Select statements. Performance and behaviour of the driver are affected by the SelectMethod setting. Direct-The direct method sends the complete result set in one request to the driver. It is useful for queries that only produce a small amount of data that you fetch completely. You should avoid using direct when executing queries that produce a large amount of data, as the result set is cached completely on the client and constrains memory. In this mode, each statement requires its own connection to the database. This is accomplished by "cloning" connections. Cloned connections use the same connection properties as the original connection; however, because transactions must occur on a single connection, auto commit mode is required. Due to this, JTA is not supported in direct mode. In addition, some operations, such as updating an insensitive result set, are not supported in direct mode because the driver must create a second statement internally. Exceptions generated due to the creation of cloned statements usually return an error message similar to "Cannot start a cloned connection while in manual transaction mode." Cursor-When the SelectMethod is set to cursor, a server-side cursor is generated. The rows are fetched from the server in blocks. The JDBC Statement method setFetchSize can be used to control the number of rows that are fetched per request. The cursor method is useful for queries that produce a large amount of data, data that is too large to cache on the client. Performance tests show that the value of setFetchSize has a serious impact on performance when SelectMethod is set to cursor. There is no simple rule for determining the value that you should use. You should experiment with different setFetchSize values to find out which value gives the best performance for your application. The default is direct. DODS supports only cursor method.