On 27/02/11 21:41, Rob Stewart wrote:
Hi, I'm trying to connect my mySql database to Fuseki, but I'm having
difficulties. I have amended the final line of the file fuseki-server:
exec java -cp /usr/share/java/mysql-connector-java.jar -Xmx1200M -jar
"$JAR" "$@"
-jar takes the classpath from inside the jarfile. I think -cp is
ignored. You'll have to unpack the jar and making a classpath with the
unpacked classes and the JDBC driver for MySQL.
Here is my tdb.ttl file:
-------------------
@prefix tdb:<http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja:<http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb:<http://jena.hpl.hp.com/2008/tdb#> .
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
Err - that's for TDB, and you want SDB.
http://openjena.org/wiki/SDB
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<#dataSource> rdf:type ja:RDFDataset ;
rdfs:label "DSpaceImage" ;
ja:defaultGraph _:ProfileDatabase
.
_:ProfileDatabase rdf:type ja:RDBModel ;
ja:connection
[
ja:dbType "MySQL" ;
ja:dbURL "jdbc:mysql://localhost/TheDatase" ;
ja:dbUser "user" ;
ja:dbPassword "password" ;
ja:dbClass "com.mysql.jdbc.Driver" ;
] ;
ja:modelName "UserProfiles"
We do not recommend the use of RDB unless it's for legacy databases.
Andy
.
--------------------------
Now when I run:
./fuseki-server --desc tdb.ttl /dataSource
I get the error:
com.hp.hpl.jena.assembler.exceptions.CannotLoadClassException: the
class 'com.mysql.jdbc.Driver' required by the object.... .... could
not be loaded.
Thanks,
--
Rob