All Apps and Add-ons

Splunk DB Connect 2: Why am I unable to load the MS SQL driver?

ctaf
Contributor

Hello,

I am trying to set up a connection in the Splunk DB Connect 2 app, but it doesn't find the driver:

failed: java.sql.SQLException:,Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'

I installed JAVA:

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

The DB-Connect app find JAVA after I enter the JAVA_HOME variable.

I copied the sqljdbc4.jar file from microsoft to /opt/splunk/etc/apps/splunk_app_db_connect/bin/

After restarting Splunk, it still doesn't find the driver.

Any ideas ?

PS: I tried to set up the CLASSPATH var as this post described : https://answers.splunk.com/answers/235666/splunk-db-connect-2-the-driver-class-commysqljdbcd.html but it doesn't work.

0 Karma
1 Solution

fdi01
Motivator

*- put .jar file to /opt/splunk/etc/apps/splunk_app_db_connect/bin/lib/ directory.
and not in /opt/splunk/etc/apps/splunk_app_db_connect/bin/ directory.
*- don't use .jar file of windows on Linux, ...

  1. Download the MySQL Connector/J driver, version 5.1.24 or later (mysql-connector-java-*-bin.jar).
  2. For Unix, Linux, and OS X, select the Platform Independent driver option, as follows: a. Download and uncompress either ZIP or TAR archive files. The uncompressed archive contains the JDBC driver (.jar). b. Copy the mysql-connector-java-version-bin.jar file to the $SPLUNK_HOME/etc/apps/splunk_app_db_connect/bin/lib directory.

View solution in original post

fdi01
Motivator

*- put .jar file to /opt/splunk/etc/apps/splunk_app_db_connect/bin/lib/ directory.
and not in /opt/splunk/etc/apps/splunk_app_db_connect/bin/ directory.
*- don't use .jar file of windows on Linux, ...

  1. Download the MySQL Connector/J driver, version 5.1.24 or later (mysql-connector-java-*-bin.jar).
  2. For Unix, Linux, and OS X, select the Platform Independent driver option, as follows: a. Download and uncompress either ZIP or TAR archive files. The uncompressed archive contains the JDBC driver (.jar). b. Copy the mysql-connector-java-version-bin.jar file to the $SPLUNK_HOME/etc/apps/splunk_app_db_connect/bin/lib directory.

psobisch
Path Finder

I downvoted this post because he was talking about mssql, not mysql.

0 Karma

ctaf
Contributor

Ohhhh you were right, I put in in /bin and not in /bin/lib.. Silly me. Thanks !

0 Karma

phaninadendla
New Member

Initial question was referred to Microsoft SqlServer db connectivity issue. But, in the accepted answer I see the references to "MySQL".
Is this solution work?

I am not sure which option to be used to connect SQLServer database from Splunk DB Connect app as I see there are 5 different options from the dropdown.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...