SQLServer + Netbeans? |
The problem is Netbean's version of Glassfish doesn't have the correct jars. Open C:\Program Files\glassfish-3.1.1\glassfish\lib; take a look and facepalm at this display of fail from Oracle.
Lets not dwell on that.
So we need a JDBC driver and a JDBC driver we shall get. Don't worry although its Microsoft, it won't cost you a thing. Documentation here. Driver here and just drop the jar file into that folder you just opened. Use the sqljdbc4.jar. Don't forget to restart the Glassfish server.
Now we redo the step in creating the JDBC connection pool resource. Here is what I did:
- Named the Pool: MSSQL2008
- Set the resource type to: java.sql.driver
- Set the driver class name to: com.microsoft.sqlserver.jdbc.SQLServerDriver
- Set my properties to the following values:
- URL = jdbc:sqlserver://{iptoserver};instanceName={name};databaseName={defaultdb};integratedSecurity=false;
- user = my admin username
- password = duh!
Don't forget to create a JDBC resource after you succeed in creating your connection pool in Glassfish. You'll need it if you want to get database access via JNDI.