D2RQ- JDBC driver in classpath

197 views
Skip to first unread message

ram

unread,
Dec 19, 2008, 2:04:30 PM12/19/08
to TopBraid Composer Users
Hi

I need to use MSSQL JDBC driver with D2RQ but I get a driver class not
found exception. It seems like all I need to do is to include the
sqljdbc.jar file in the class path so that D2RQ can pick it up. How do
I do this?

Error:
de.fuberlin.wiwiss.d2rq.D2RQException: Database driver class not
found: com.microsoft.sqlserver.jdbc.SQLServerDriver (E42)
at de.fuberlin.wiwiss.d2rq.map.Database.registerJDBCDriver
(Database.java:47)
at de.fuberlin.wiwiss.d2rq.map.Database.connectedDB(Database.java:
152)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.connectToDatabase
(MappingGenerator.java:165)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.run
(MappingGenerator.java:127)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard.run
(ImportD2RQWizard.java:108)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard$1.run
(ImportD2RQWizard.java:54)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:121)

Anyways I also tried the jTDS driver and I get this
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not
loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>
(ConnectionJDBC2.java:344)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>
(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.connect(ConnectedDB.java:
78)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.connection
(ConnectedDB.java:67)
at de.fuberlin.wiwiss.d2rq.dbschema.DatabaseSchemaInspector.<init>
(DatabaseSchemaInspector.java:71)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.schemaInspector
(ConnectedDB.java:86)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.connectToDatabase
(MappingGenerator.java:165)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.run
(MappingGenerator.java:127)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard.run
(ImportD2RQWizard.java:108)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard$1.run
(ImportD2RQWizard.java:54)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:121)
Caused by: java.io.IOException: SSO Failed: Native SSPI library not
loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:
1889)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
... 14 more
de.fuberlin.wiwiss.d2rq.D2RQException: rethrew: java.sql.SQLException:
I/O Error: SSO Failed: Native SSPI library not loaded. Check the
java.library.path system property.
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.connect(ConnectedDB.java:
80)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.connection
(ConnectedDB.java:67)
at de.fuberlin.wiwiss.d2rq.dbschema.DatabaseSchemaInspector.<init>
(DatabaseSchemaInspector.java:71)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.schemaInspector
(ConnectedDB.java:86)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.connectToDatabase
(MappingGenerator.java:165)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.run
(MappingGenerator.java:127)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard.run
(ImportD2RQWizard.java:108)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard$1.run
(ImportD2RQWizard.java:54)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:121)
Caused by: java.sql.SQLException: I/O Error: SSO Failed: Native SSPI
library not loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>
(ConnectionJDBC2.java:344)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>
(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at de.fuberlin.wiwiss.d2rq.sql.ConnectedDB.connect(ConnectedDB.java:
78)
... 8 more
Caused by: java.io.IOException: SSO Failed: Native SSPI library not
loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:
1889)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
... 14 more

Ram

Scott Henninger

unread,
Dec 19, 2008, 4:32:16 PM12/19/08
to TopBraid Composer Users
Ram, it's not clear exactly how you addressed this in the wizard.
There are two key fields that need to be set up with the driver
package that you have. The following are examples - you will need to
give these proper names according to your setup.

Driver Class: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
make sure your driver class is included, not just the .jar driver
class. You may need to open the .jar to find it.

Driver Jar URL: 'file:///C:/sqlserver/jdbcsql.jar'
this assumes a localhost installation in the directory "C:/
sqlserver" and a jdbcsql.jar file containing the driver (i.e. the
location of the .jar file containing the Driver Class)

-- Scott

ram

unread,
Dec 19, 2008, 5:20:21 PM12/19/08
to TopBraid Composer Users
Thanks for your response Scott..

I do not an input field for "Driver Jar URL" in my wizard. I am using
TBC maestro edition v2.6.2..

ram

On Dec 19, 1:32 pm, Scott Henninger <shennin...@topquadrant.com>
wrote:
> > Ram- Hide quoted text -
>
> - Show quoted text -

Dave butlerdi

unread,
Dec 19, 2008, 6:24:09 PM12/19/08
to topbraid-co...@googlegroups.com
Preferences --> Data Management -->Driver Definitions --> add ... should do it....
--
Regards

Dave Butler
butlerdi-at-pharm2phork-dot-org

Also on Skype as butlerdi

Get Skype here http://www.skype.com/download.html


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

ram

unread,
Dec 19, 2008, 7:28:00 PM12/19/08
to TopBraid Composer Users
nope.. still the same error :(

--error log--
eclipse.buildId=I20080617-2000
java.version=1.5.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86


Error
Fri Dec 19 16:25:08 PST 2008
de.fuberlin.wiwiss.d2rq.D2RQException: Database driver class not
found: com.microsoft.sqlserver.jdbc.SQLServerDriver (E42)

de.fuberlin.wiwiss.d2rq.D2RQException: Database driver class not
found: com.microsoft.sqlserver.jdbc.SQLServerDriver (E42)
at de.fuberlin.wiwiss.d2rq.map.Database.registerJDBCDriver
(Database.java:47)
at de.fuberlin.wiwiss.d2rq.map.Database.connectedDB(Database.java:
152)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.connectToDatabase
(MappingGenerator.java:165)
at org.topbraidcomposer.d2rq.wizard.MappingGenerator.run
(MappingGenerator.java:127)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard.run
(ImportD2RQWizard.java:108)
at org.topbraidcomposer.d2rq.wizard.ImportD2RQWizard$1.run
(ImportD2RQWizard.java:54)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:121)



> Get Skype herehttp://www.skype.com/download.html
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************- Hide quoted text -

Dave butlerdi

unread,
Dec 20, 2008, 2:50:36 PM12/20/08
to topbraid-co...@googlegroups.com
Seems starange, but looking at it a bit I think I would try running D2RQ from the command line to see if it will run. I saw a post before that stated that you must remove the "com.microsoft" from the driver class as well. Others with this problem saw that they had possibly the wrong version of the driver.
Get Skype here http://www.skype.com/download.html

Scott Henninger

unread,
Dec 21, 2008, 4:47:41 PM12/21/08
to TopBraid Composer Users
Ram; Let's start from the top. Use Import... OWL/RDFS View on
Relational Database with D2RQ to bring up the D2RQ wizard and
specified something similar to the folowing:

Database URL: file:///C:/sqlserver/jdbcsql.jar
- path to the driver .jar file assuming a localhost solution
Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver (or
sqlserver.jdbc.SQLServerDriver)
- depending on your driver, the name "SQLServerDriver" may be
different

If jTDS is used instead, the database URL should be
jdbc:jtds:MsSQL://<host>[:<port>][/<database>]

... here the host, port an database refer to the specific database
instance you are trying to use.

Beyond that, more information would be needed on your specific setup
to help out.
-- Scott

ram

unread,
Dec 22, 2008, 12:38:35 PM12/22/08
to TopBraid Composer Users
Hey scott

I am doing all the things you are asking me to.

BTW, I am able to run D2RQ (v-0.5.1) from the command line using the
same parameters.. The first few lines of the mapping file produced by
generate-mapping are below.

---
[D2RQ] Database is: Microsoft SQL Server, version: 9.00.3042
@prefix map: <file:///stdout#> .
@prefix db: <> .
@prefix vocab: <vocab/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .

map:database a d2rq:Database;
d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
d2rq:jdbcDSN "jdbc:sqlserver://xxx.xx.xx.xx:
1433;database=ChevronIAM_XXX;integratedSecurity=true";

---

On Dec 21, 1:47 pm, Scott Henninger <shennin...@topquadrant.com>
> > > - Show quoted text -- Hide quoted text -

Scott Henninger

unread,
Dec 22, 2008, 12:56:11 PM12/22/08
to TopBraid Composer Users
Ram; I guess I'm a little confused at this point. You have a
mapping, but are you saying it doesn't work or something? What is or
isn't happening that you expect? I'm also unclear on what you mean by
a "command line". Do you mean using the D2RQ server directly - i.e.
not using Composer?

-- Scott

ram

unread,
Dec 22, 2008, 1:04:28 PM12/22/08
to TopBraid Composer Users
The output I show above is NOT generated by TBC. The D2RQ package has
a script/batch file called generate-mapping which I used to generate
the output above.

What I want is TBC to generate an OWL schema from the database tables.
So i tried doing it through import using D2RQ. Thats when I get the
"driver not found" error..

hope this clarifies things..
ram

On Dec 22, 9:56 am, Scott Henninger <shennin...@topquadrant.com>

Scott Henninger

unread,
Dec 22, 2008, 1:57:42 PM12/22/08
to TopBraid Composer Users
Thanks Ram, that does help some. The generate-mapping script in D2RQ
will generate a mapping, but does no verification and therefore will
take any input. Composer will verify the existence of the driver
before creating the mapping. Therefore, while the generate-mapping
script will create a mapping file, it may or may not specify a
successful connection to the database. In your case I suspect it
won't.

The "driver not found" message from D2RQ (when using the Composer
Import wizard) is stating it like it is. The driver is not being
found. In particular, you need to find the correct addressing for the
Driver Class for your SQLServer installation. It appears that
com.microsoft.sqlserver.jdbc.SQLServerDriver is not correct for yor
setup. Check the setup for your SQLServer database instance. Some
SQLServer packages require a separate installation for the SQLServer
driver. There may also be problems with getting the .jar file in the
CLASSPATH - for example Java doesn't tolerate spaces in the path.

If you can't get that to work. jTDS is an option.

-- Scott
> ...
>
> read more »

ram

unread,
Dec 22, 2008, 2:12:04 PM12/22/08
to TopBraid Composer Users
I am quite sure the D2RQ script is connecting to my database alright.
I cannot show you the rest of the current mapping file but it contains
the mapping for all the tables (class maps, property bridges and all
that good stuff) in the database. Infact even the "dump-rdf" runs
succesfully and retrieves all the content of the database tables into
an RDF file. i think there is no way it can do it without a
connection.. If you really want me to, I could create a dummy
database and get the complete D2RQ mapping created for it..

ram.

On Dec 22, 10:57 am, Scott Henninger <shennin...@topquadrant.com>
wrote:
> ...
>
> read more »- Hide quoted text -

Scott Henninger

unread,
Dec 22, 2008, 7:53:26 PM12/22/08
to TopBraid Composer Users
Ram; It appears there are some issues with Eclipse and classpaths.
Since each plugin uses an isolated classpath, Composer is not able to
find your .jar because D2RQ is in a different plugin. We will look
into better ways to manage JDBC drivers for future releases.

Meanwhile, jTDS is a viable option, and may be a better way to connect
to Microsoft databases via Eclipse in general. The SQLException you
cited when trying jTDS indicates a Windows authentication issue. Your
setup may require using SLQServer's authentication, in which case you
need to include authentication in the URL:

jdbc:jtds:<db type>://<host>[:<port>][/<database>]
[;user=XXX;password=YYY]

I generalized the syntax from before. <db type> should be MsSQL, but
sqlserver is used in jTDS documentation.

-- Scott
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages