Java Studio Creator, Sun Java System Application Server Platform Edition(PE), and SQLServer
By David Botterill on Feb 01, 2006
java.sql.SQLException: [sunm][SQLServer JDBC Driver]This driver is locked for use with embedded applications
This exception is thrown from the “smsqlserver.jar” SQLServer JDBC driver. This driver is meant to be used within the SJSAS PE bundled with Creator 2.
There are a couple of options for getting around this.
Option 1 – Use Sun Java System Application Server Enterprise Edition 8.1 2005Q1
If you check out the “Features and Benefits” between Sun Java System Application Server Platform Edition (http://www.sun.com/software/products/appsrvr_pe/features.xml) and Enterprise Edition (http://www.sun.com/software/products/appsrvr_ee/features.xml), you'll notice the Enterprise Edition lists the following.
Integrated JDBC driver collection - Pre-integrated and certified - allowing you to quickly and easily connect your applications to corporate data sources.
So to fix the issue, you can always install SJSAS Enterprise Edition.
Option 2 – Use the jTDS SQLServer JDBC Driver
There is a sourceforge.net project called “jTDS” (http://jtds.sourceforge.net/). This is an open source JDBC driver for SQLServer. You can define a data source in Creator 2 for the jTDS driver and point the data source at your SQLServer database. To do this, follow the instructions in the tutorial “Creating Database Server Types and Data Sources”. When you setup the remote deploy to the SJSAS EE, you need to choose “Data Sources Configured Automatically by JSCreator”. The following diagram shows a snapshot of the dialog.
Creator will setup up the necessary data configurations on SJSAS PE so the Data Direct driver is used as the DataSource driver and the jTDS driver is used for the JDBC driver.
Lastly, you'll need to copy “Creator_install_dir/startup/samples/driveradapter.jar” into the “AppServer_install_dir/lib” directory.
There's a Creator forum discussion around this topic at http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=51299
Many thanks to Jerry Dunn for helping me work through this.