Configure WLS 11g for MS SQL ServerPublished on: Author: Michel Schildmeijer Category: Oracle
WebLogic Server supports many different types of databases, and offers even support for Open Source. This is a short blogpost about how to make a datasource connection with a MS SQL Server database version 7, using the open source driver net.sourceforge.jtds.jdbc.Driver. jTDS gives good performance for both SQL Server and Sybase.
1. Upload the jtds jar package to the WLS Host
The jtds-1.2.1.jar is an open source Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000 and 2005) and Sybase (10, 11, 12, 15), compatible with WLS 11g.
You can download it from http://jtds.sourceforge.net/
Upload it to your WebLogic Server host and place it under the WebLogic Server home,
2. Load the driver in your WLS Server’s CLASSPATH
Navigate to the WebLogic Server home, common/bin, and edit the commEnv.sh (note do not copy and paste this because it contains white-spaces!)
# set up WebLogic Server’s class path
Restart your AdminServer to reflect these changes
3. Create a datasource to your MS SQL Database
In your Admin Console create a new datasource to the MS SQL database. Use for database type MS SQL Server.
Use ‘Other’ for Database Driver.
Leave the transaction details on the next page as default and click next.
Fill in your database details.
On the next page fill in:
• The driver class name : net.sourceforge.jtds.jdbc.Driver
• Connection URL:
jdbc:jtds:sqlserver://<MS SQL Host>;instance=<MS SQL Instance>;DatabaseName=<Name of MS SQL Database>
Click on Test Configuration, the connection should be successful.
Target the datasource to the proper managed server instance(s) and click finish.
Easy does it!
Instead of adding it to the Server CLASSPATH, you might also consider to upload the jar file to your Domains root folder and place it under lib. Then it also loads after startup. But for a more consistent solution (to my opinion) add as described above.