This HOWTO was written some time ago and was targeted at the version of Torque that was coupled with the Turbine application framework. Contributions towards updating the information below can be submitted to the Torque Dev mailing list.
This howto contains configuration help on using MS SQL Server with Turbine. This Howto supplements the TDK Howto page.
We appreciate all patches and contributions that improve this document.
Use the SQL Server Enterprise Manager to create the database. When using the TDK, it helps to name the database the same name as your project. If the name is not the same, you will need to manually change the database name in your properties files. After the database is created, you will need to create a new user, or give an existing user permissions to the new database. Create the new user with SQL Server Authentication, and assign the users default database to the newly created database. Make sure the database user has the db_owner role. Please refer to SQL Server documentation for further details.
Microsoft has a JDBC driver for MS SQL Server available from their SQL Downloads page. Alternately, a third party commercial driver from JDBC(TM) Technology - Drivers, the JDBC-ODBC bridge driver from Sun, or one of the free drivers, FreeTDS or jTDS can be used.
The driver from FreeTDS, as of version 0.51, is unstable and buggy, and not recommended for production environments. Use at your own risk. If you have used a more recent version of FreeTDS successfully then please let us know.
We have only recently been informed of the existence of jTDS, which is based on FreeTDS. Try it out and let us know how it goes.
The JDBC-ODBC bridge driver from Sun is included with the Java 2 SDK Standard Edition as package sun.jdbc.odbc. Sun's statement on this driver is, "Note that the bridge driver included in the SDK is appropriate only for experimental use or when no other driver is available." So use at your own risk. Also, if you are using a non-windows box to run Turbine, you will need to find ODBC drivers for SQL server for that platform. For UNIX environments, you can use unixODBC. Please follow the ODBC driver instructions and setup a DSN for the new database. You must uncheck the box that says, "Use ANSI nulls, paddings and warnings.".
In the ...\WEB-INF\build\build.properties file make sure that;
And set the JDBC connection information:
If you are using the Microsoft driver
(i.e. com.microsoft.jdbc.sqlserver.SQLServerDriver
),
you'll need to use the SelectMethod=cursor
parameter in
the JDBC connection string (as outlined by this
JDC thread). Your databaseUrl
would look something
like the following:
If you are using the JDBC-ODBC bridge driver:
In the ..\WEB-INF\conf\TurbineResources.properties file, set;