# Logstash 6.2.2 JDBC-DB2 input problem

**URL:** <https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975>\
**Category:** Logstash\
**Created:** [March 14, 2018, 6:29pm UTC](https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975 "2018-03-14T18:29:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsi](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@lsi](https://discuss.elastic.co/u/lsi)\
**Post date:** [March 14, 2018, 6:29pm UTC](https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975/1 "2018-03-14T18:29:53Z")

</div>

Hi All,

I was using an earlier version of Logstash (5.\*) and reading data from a DB2 instance with no issues using the following input params  
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:db2://...URL"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pass"  
jdbc\_driver\_library =\> "/usr/share/logstash/jdbc\_lib/db2jcc4.jar"  
jdbc\_driver\_class =\> "com.ibm.db2.jcc.DB2Driver"  
statement =\> "select \* from ..."  
}  
................

After upgrading to Logstash 6.2.2, this no more works and throws an exception:

[2018-03-14T14:08:13,752][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Pipeline\_id:main  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_connection\_string=\>"jdbc:db2:....", jdbc\_user=\>"DB2INST1", jdbc\_password=\>, jdbc\_driver\_library=\>"/usr/share/logstash/jdbc\_lib/db2jcc4.jar", jdbc\_driver\_class=\>"com.ibm.db2.jcc.DB2Driver", statement=\>"select \* ...", id=\>"220461e62489d47a8983ece494545cebee2133442d8a65e3131ae7ff537d394c", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_e96d7f96-9fac-4769-b744-3bcccc7122ae", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validate\_connection=\>false, jdbc\_validation\_timeout=\>3600, jdbc\_pool\_timeout=\>5, sql\_log\_level=\>"info", connection\_retry\_attempts=\>1, connection\_retry\_attempts\_wait\_time=\>0.5, parameters=\>{"sql\_last\_value"=\>2018-03-14 16:48:54 UTC}, last\_run\_metadata\_path=\>"/root/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
Error: com.ibm.db2.jcc.DB2Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?  
Exception: LogStash::ConfigurationError  
Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin\_mixins/jdbc.rb:159:in open\_jdbc\_connection' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin\_mixins/jdbc.rb:227:inexecute\_statement'  
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:271:in execute\_query' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:256:inrun'  
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:516:in `inputworker'

Note that the earlier and current Logstash instances could access and query tables from a MySQL and a PostgreSQL instances with no problems (and their jar files are in the same path as the DB2 jar file), so the issue seems DB2 specific. Also note that I tried adding a DB2 license file as follows, but that did not make any difference:  
jdbc\_driver\_library=\>"/usr/share/logstash/jdbc\_lib/db2jcc4.jar,/usr/share/logstash/jdbc\_lib/db2jcc\_license\_cu.jar"

Any feedback is appreciated. Any examples on using Logstash 6.2.\* with DB2 are appreciated, too.

Regards.

---

<div class="post-metadata">

**Author:** ![lsi](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@lsi](https://discuss.elastic.co/u/lsi)\
**Post date:** [March 19, 2018, 8:40pm UTC](https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975/2 "2018-03-19T20:40:00Z")

</div>

Are there any examples on using DB2 with Logstash 6.2.\*?  
Thanks.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [March 20, 2018, 7:33am UTC](https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975/3 "2018-03-20T07:33:24Z")

</div>

> [@lsi](#):
>
> /usr/share/logstash/jdbc\_lib/db2jcc4.jar

Does this jar still exist at this location with appropriate permissions, or was it overwritten during the upgrade?

The error message seems to indicate that either this jar is not present, or it does not provide the class `com.ibm.db2.jcc.DB2Driver`:

> [@lsi](#):
>
> Error: com.ibm.db2.jcc.DB2Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

---

<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:** [April 17, 2018, 7:33am UTC](https://discuss.elastic.co/t/logstash-6-2-2-jdbc-db2-input-problem/123975/4 "2018-04-17T07:33:58Z")

</div>

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