# Logstash with jdbc input for Oracle DB

**URL:** <https://discuss.elastic.co/t/logstash-with-jdbc-input-for-oracle-db/94315>\
**Category:** Logstash\
**Created:** [July 24, 2017, 11:22am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-for-oracle-db/94315 "2017-07-24T11:22:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jyothig](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Jyothig](https://discuss.elastic.co/u/Jyothig)\
**Post date:** [July 24, 2017, 11:22am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-for-oracle-db/94315/1 "2017-07-24T11:22:45Z")

</div>

I updated jdbc details as below:

```
    jdbc_driver_library => "../ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin@//<<my-host>>:1521/<<my-sid>>"

```

The user and pass word are provided in jdbc\_user and jdbc\_password configurations correctly.

When I run this, I am getting following error:

Pipeline aborted due to error {:exception=\>"Sequel::DatabaseConnectionError", :backtrace=\>["oracle.jdbc.driver.OracleDriver.connect(oracle/jdbc/driver/OracleDriver.java:423)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "RUBY.connect(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/adapters/jdbc.rb:222)", "RUBY.make\_new(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool.rb:116)", "RUBY.make\_new(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:228)", "RUBY.available(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:201)", "RUBY.\_acquire(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:137)", "RUBY.acquire(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:151)", "RUBY.sync(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:282)", "org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:149)", "RUBY.sync(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:282)", "RUBY.acquire(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:150)", "RUBY.acquire(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/extensions/connection\_validator.rb:98)", "RUBY.hold(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/connection\_pool/threaded.rb:106)", "RUBY.synchronize(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/database/connecting.rb:256)", "RUBY.test\_connection(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/sequel-4.37.0/lib/sequel/database/connecting.rb:266)", "RUBY.prepare\_jdbc\_connection(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstash/plugin\_mixins/jdbc.rb:173)", "RUBY.register(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstash/inputs/jdbc.rb:187)", "RUBY.start\_inputs(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)", "RUBY.start\_inputs(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329)", "RUBY.start\_workers(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180)", "RUBY.run(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136)", "RUBY.start\_pipeline(C:/InsightExplorer/ElasticSearch-inSightExplorer/logstash-2.4.0-insight/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491)", "java.lang.Thread.run(java/lang/Thread.java:748)"], :level=\>:error}e[0m  
stopping pipeline {:id=\>"main"}  
The signal HUP is in use by the JVM and will not work correctly on this platform

To get more verbose on the logged error, based on response from logstash plugin manager on link [Logstash Oracle JDBC issue](https://discuss.elastic.co/t/logstash-oracle-jdbc-issue/71814), tried this with Logstash 5.0 , and below error is received

[2017-07-24T15:12:02,486][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_driver\_library=\>"../ojdbc6.jar", jdbc\_driver\_class=\>"Java::oracle.jdbc.driver.OracleDriver", jdbc\_connection\_string=\>"jdbc:oracle:thin@\\my-host:1521\my-sid", jdbc\_user=\>"myuserid", jdbc\_password=\>, jdbc\_validate\_connection=\>true, statement=\>"SELECT AGENC.AG\_ID,AGENC.AG\_NME FROM AGENCY", type=\>"cadagencies", id=\>"bfff23913d32e7f49b26f1  
136daf1fce22cf7156-1", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_50e5f4f1-fbe5-4de1-a96f-8953840c284c", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_p  
age\_size=\>100000, 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"=\>201  
7-07-20 10:40:24 UTC}, last\_run\_metadata\_path=\>"C:\Users\nborra/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase  
\_column\_names=\>true\>  
Error: undefined method `close\_jdbc\_connection' for #Sequel::JDBC::Database:0x7118d17  
[2017-07-24T15:12:03,489][WARN][logstash.inputs.jdbc] Exception when executing JDBC query {:exception=\>#\<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: Invalid Oracle URL specifie  
d\>}  
[2017-07-24T15:12:24,396][WARN][logstash.inputs.jdbc] Attempt reconnection.

Error: undefined method `close\_jdbc\_connection' for #Sequel::JDBC::Database:0x7118d17  
\<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: Invalid Oracle URL specifie  
d\>}

Can you please help me what is that I am missing?

---

<div class="post-metadata">

**Author:** ![Jyothig](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Jyothig](https://discuss.elastic.co/u/Jyothig)\
**Post date:** [July 25, 2017, 11:56am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-for-oracle-db/94315/2 "2017-07-25T11:56:25Z")

</div>

Figured it out, I missed the : after thin in jdbc connection and I did not need // after @. So, the below one worked for me, @jdbc:oracle:thin:@\<\<\>my\_hots\>:1521:\<\<my\_sid\>\> worked

---

<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:** [August 22, 2017, 11:56am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-for-oracle-db/94315/3 "2017-08-22T11:56:49Z")

</div>

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