Search code examples
graphdb

Adding jdbc driver when creating Ontop Virtual repository problem


I'm having problems adding a jdbc driver when creating an Ontop virtual SPARQL repository. I follow the instructions here. The interface already warns that there is no JDBC driver found in the classpath. There is also a link to the download site where you can get the drivers. That all works. But adding the driver to the lib path (in the case of a Linux installation \opt\graphdb-free\app\lib) and then restarting GraphDB does not work. GraphDB is still reporting that the driver is not found.

I did try a lot of things. Adding the correct .jar to the CLASSPATH did not work. Using several other potential lib directories (the instructions are not precise on which directory to choose) also changed nothing. Then I took a look in the files you can create under Help - System Information - New Report. I found that all the .jar files in \opt\graphdb-free\app\lib were 'registered' (don't know if that is the correct term), but not the new one I placed there.

Tried adding other .jars (for MS SQL, next to the MySQL that I needed). Same problem. Then I tried something weird that actually worked. I renamed a .jar that I thought I wouldn't need to .backup and then renamed the mysql driver .jar to that original .jar (hope this is not to confusing). Restarted Grapdb and it worked!

What am I missing here? Is the list of .jars that are in the lib directory hardcoded somewhere? Very curious how to configure this the right way.


Solution

  • There is a config file, named graphdb-free.cfg, within graphdb-free/appfolder. Open it and alter the app.classpath property by adding the additional jar(s) for the JDBC driver to the list. Save and restart