SQL Sever 2012 - JDBC Driver is not on the classpath - SOLVED

Post Reply
adgarcia
Posts: 13
Joined: 28 Sep 2017, 20:20

Greetings,

I have seen variations of this topic but I can assure you my setup is correct, at least according to the documentation I've seen; I am stuck on step 14 of the Multi user install.

I am on Windows 7 Pro SP1, using Protégé 3.5, trying to host the essential repository in a SQL Server 2012 database and am getting the infamous "The JDBC Driver is not on the classpath" error when trying to convert a project to a database format.

I have downloaded the supported version of the JDBC driver for SQL Server 2012, and moved it to the Protégé root directory C:\Program Files\Protege_3.5\ as driver.jar

I have tried to start Protégé both via the start menu and run_protege.bat file, in both cases I can see in the DOS window that the following gets executed:

set JARS=protege.jar;looks.jar;unicode_panel.jar;driver.jar;driver1.jar;driver2.jar
%JAVA_PATH%\java %OPTIONS% -cp %JARS% %MAIN_CLASS% %1

and yet I still get this error. The protégé install itself ran fine. Any ideas on how I can get past this issue?

By the way I've cross-posted this on the Protege support forum.

Thanks in Advance,

David
Last edited by adgarcia on 10 Oct 2017, 13:20, edited 2 times in total.
adgarcia
Posts: 13
Joined: 28 Sep 2017, 20:20

I should mention my parameters in the 'convert' panel are set to:

- Driver Class Name: com.microsoft.sqlserver.jdbc.SQLServerDriver
- URL: jdbc:sqlserver://localhost;databaseName=essentialdb

which looks right.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi David,

Thanks for your post.

Your connection parameters do seem to be looking good.

One thing to check with SQL Server is which version of the JDBC driver you are using. There are 2 versions and it’s important to make sure these are aligned.
For example, I have used ‘sqljdbc4.jar’ a number of times successfully and I know that there are at least 2 drivers to choose from when you download the JDBC driver from Microsoft. It may be that you need to use the version 4 driver, if you’re not already.

You’ve mentioned that you’ve tried running Protege from both the Start Menu icon and from the command line - with the same results. When running from the Start Menu, have you checked the Protege LAX configuration? (File -> Preferences ->Property Files and then selected protege.lax)

Which version of Java are you using? Although it’s not the latest version, using the ‘bundled’ Java with Protege is often the path of least resistance. If you are using an alternative JVM (which is completely fine), there are some additional configuration things that need to be checked with respect to paths etc. in the configuration files of Protege.

Let us know how you get on

Jonathan
Essential Project Team
adgarcia
Posts: 13
Joined: 28 Sep 2017, 20:20

Thanks Jonathan,

So as it turns out I got past the classpath error; I made the mistake of referencing someone's blog on the internet and as it turns out they had the classpath syntax as "com.microsoft.jdbc.sqlserver.SQLServerDriver" instead of "com.microsoft.sqlserver.jdbc.SQLServerDriver" and it took me a while to figure out I had the string constructed incorrectly; my bad..

Once I got past that part I am now facing another issue, which is I am now getting the error:

The driver was found but it is not possible to create a connection with the driver URL. Perhaps the URL Syntax is wrong or the username/password is invalid.

Login failed for user 'essential' ClientConnectionId:937ce712.58d6-xxxx....

The URL syntax is: jdbc:sqlserver://localhost:51934;databaseName=essentialdb

When i change the port number to let's say 4133, I get "connection refused" so I am pretty sure I am connecting to the localhost and port. I have given the db user 'essential' full admin authority to the essentialdb and schema I have created and yet still have this issue.

Any help is appreciated. Thanks,

David
Post Reply