# Logstash JDBC Plugin Driver Not Loaded Error

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000>\
**Category:** Logstash\
**Created:** [November 18, 2015, 9:47pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000 "2015-11-18T21:47:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [November 18, 2015, 9:47pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/1 "2015-11-18T21:47:23Z")

</div>

Hello all, I have been trying to use the jdbc input plugin for logstash but keep getting a driver not loaded error. Specifically, I am using logstash-2.0.0 and the oracle jdbc jar (ojdbc6.jar). I have seen similar issues on Github (e.g. [https://github.com/logstash-plugins/logstash-input-jdbc/issues/43](https://github.com/logstash-plugins/logstash-input-jdbc/issues/43)) relating to specifying the name of the driver class correctly, but I am using the name explicitly specified in the documentation ( [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc\_driver\_class](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc_driver_class)). The exact error I'm getting is "Error: Java::oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?". My config file (had to scrub some connection details) is:

```
input {
  jdbc {
    jdbc_driver_library => "/opt/logstash/lib/ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin:@ldap://example.com:389/db01,dc=example,dc=com"
    jdbc_user => "user"
    jdbc_password => "password"
    parameters => { "Where_Clause" => "O%"}
    schedule => "* * * * *"
    statement => "SELECT * from MAIN"
  }
}
output {file{ path=> "/home/test.txt"}}

```

I was wondering if this might be a logstash-2.0.0 issue? Thanks!

EDIT: The issue was with the jdbc jar file, it had been corrupted. After re-downloading the jar everything is working fine!

.

---

<div class="post-metadata">

**Author:** ![anish](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anish](https://discuss.elastic.co/u/anish)\
**Post date:** [November 27, 2015, 1:46pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/2 "2015-11-27T13:46:03Z")

</div>

Hi , I am getting exactly the same error  
"  
_Error: java::oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've inc_  
_luded the correct jdbc driver in :jdbc\_driver\_library?_  
_You may be interested in the '--configtest' flag which you can_  
_use to validate logstash's configuration before you choose_  
_to restart a running system._  
"  
but didn't worked after re-downloading the jar. I am using logstash-2.1.0. Configuration test is OK  
Below is my config

input {  
jdbc {  
jdbc\_driver\_library =\> "E:/Lab/jdbc\_driver/ojdbc6.jar"  
jdbc\_driver\_class =\> "java::oracle.jdbc.driver.OracleDriver"  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@[//192.168.1.2:1521/testdb](https://192.168.1.2:1521/testdb)"  
jdbc\_user =\> "usr"  
jdbc\_password =\> "password"  
jdbc\_validate\_connection =\> true  
parameters =\> { "person\_id" =\> "10001" }  
statement =\> "SELECT \* FROM person where person\_id = :person\_id"  
}  
}  
output {  
elasticsearch {  
index =\> "person\_id"  
document\_type =\> "person"  
document\_id =\> "%{uid}"  
hosts =\> "127.0.0.1:9200"  
}

---

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [November 27, 2015, 4:42pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/3 "2015-11-27T16:42:19Z")

</div>

Hey Anish, could you try [unzipping the JAR](https://docs.oracle.com/javase/tutorial/deployment/jar/unpack.html) and and viewing the files inside? The problem I had was that when I downloaded the JAR file from the command line onto to my virtual machine, the JAR file was actually empty because Oracle requires a username and password (it was very confusing because the download appeared to go smoothly, but when I unzipped the JAR, after trying many other things, it was empty). I ended up downloading the JAR using my web browser on my local machine, unzipping the JAR to make sure it was not empty, and then copying the JAR onto my virtual machine. Since then everything has worked perfectly.

---

<div class="post-metadata">

**Author:** ![anish](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anish](https://discuss.elastic.co/u/anish)\
**Post date:** [December 2, 2015, 9:39am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/4 "2015-12-02T09:39:03Z")

</div>

Thank you Jeromefroe.  
I could see many class files when unpacking the jar, so I think jar is not corrupted.

---

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [December 2, 2015, 12:49pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/5 "2015-12-02T12:49:46Z")

</div>

Hey Anish, the only other suggestion I have is to try capitalizing the J in Java in the connection string. So "java::oracle.jdbc.driver.OracleDriver" becomes "Java::oracle.jdbc.driver.OracleDriver". Good Luck!

---

<div class="post-metadata">

**Author:** ![anish](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anish](https://discuss.elastic.co/u/anish)\
**Post date:** [December 2, 2015, 1:40pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/6 "2015-12-02T13:40:51Z")

</div>

Thanks a lot Jeromefroe, it worked for me 🙂

---

<div class="post-metadata">

**Author:** ![jeromefroe](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jeromefroe](https://discuss.elastic.co/u/jeromefroe)\
**Post date:** [December 2, 2015, 2:05pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/7 "2015-12-02T14:05:08Z")

</div>

Awesome!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:20am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-driver-not-loaded-error/35000/8 "2017-07-06T05:20:21Z")

</div>


