Where to put a jdbc driver on windows 10 for stardog?

In this tutorial Using Virtual Graphs | Stardog Documentation Latest I find these instructions for Linux (but none for Windows):

JDBC Setup

Stardog does not ship with JDBC drivers so you need to manually copy the JAR file containing the driver for your RDBMS into the classpath of the Stardog server. The preferred way of doing this is by setting the STARDOG_EXT environment variable to point to a directory outside the Stardog installation directory and copy the jar file there:

$ export STARDOG_EXT=/opt/stardog/ext
$ mkdir $STARDOG_EXT

Note that the environment variable needs to be set before the Stardog server is started. If the variable was already set before the server is started then the JAR files can be copied to that location while the server is running without a restart.

Where is the right place to place this mysql jdbc jar file on windows 10 stardog installation?


Hi Radu,

You can place them inside the Stardog installation directory under server/dbms. You can also set an environment variable (either system level, user level, or in a command prompt) for STARDOG_EXT and place the jar(s) there

I believe you can put it anywhere you want. Create a folder, possibly in your home directory, to contain the jar. Add that folder to your path and create an environment variable for STARDOG_EXT. Its value should be the complete pathname of your new folder.

strange - my path ends with ...;C:\STARDOG_EXT and

dir C:\STARDOG_EXT results in:
 Directory of C:\STARDOG_EXT
03/29/2022  03:34 PM    <DIR>          .
03/29/2022  03:34 PM    <DIR>          ..
03/29/2022  02:25 PM         2,476,480 mysql-connector-java-8.0.28.jar

Then I restarted the Stardog service and still no luck - getting

Did you create the environment variable as well?

yes - i did for my local account

That should work, although it's a little confusing having the directory the exact same name as the env variable. You also have to have permissions to read the jar in that directory for the user that is running Stardog. You'll also need to restart Stardog for it to see the env variable.....maybe. I'm actually not sure exactly how windows handles shells and env variables but it couldn't hurt to restart.

finally - a 2x4 approach worked - copied the file into \client\api - and it worked!

That’s odd because that shouldn’t have worked or at least that might not have been what did it. I would suggest figuring out what the problem was with using the STARDOG_EXT environment variable. You can alternatively create the directory $STARDOG_HOME/server/ext and put it in there. That keeps your ext jars separate from the system jars. The advantage to using the environment variable is it survives upgrades.

As always it needs to be readable by the user that is running Stardog.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.