Page 1 of 1

JDBC error and MS SQL Server

Posted: Fri Feb 28, 2014 2:08 am
by Skychan
I think I set up JDBC for SQL Server correct and all the other requirements from this guide:

http://docs.broadleafcommerce.org/core/current/broadleaf-concepts/key-aspects-and-configuration/database-configuration/ms-sql-server

but when I run site's jetty-start, I get this error:

JdbcServicesImpl - HHH000342: Could not obtain connection to query metadata : Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'


here is my jett-env.xml (the same thing in 3 spots in two xml docs):

<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">com.microsoft.sqlserver.jdbc.SQLServerDriver</Set>
<Set name="url">jdbc:sqlserver://SKYSTRIDER-PC\SKYSTRIDER:1433;DatabaseName=heatclinic</Set>
<Set name="username">heat</Set>
<Set name="password">**********</Set>
</New>

Re: JDBC error and MS SQL Server

Posted: Sat Mar 01, 2014 2:13 am
by Skychan
Step 4 of the Guide I linked to at the top:
Follow the instructions for your application server for creating a JNDI resource(s). Note that the driver does not go inside the war file(s). Rather it must go on the class path of the server.

I don't really know if I did that.

But the main problem right now just appears being able to load the jdbc driver class. According to this page, JDBC 4 supports JRE7 and NOT JDK7.

http://blogs.msdn.com/b/jdbcteam/archiv ... jre-7.aspx

So... what do I do?

Re: JDBC error and MS SQL Server

Posted: Sat Mar 01, 2014 5:32 pm
by Skychan
I installed JDK 1.6.0_45, made it default JRE in Eclipse.
I right clicked on each of admin, core, site under My Broadleaf Site, clicked ->RunAs -> Configurations, went to Classpath tab and added a reference to :

C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar

Here is my environment classpath variable:
.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar

I haven't found any documentation suggesting to do anything more or different than what I've done. I welcome any help, thx