No Suitable Driver Found for jdbc:Cache://ipaddress:port/namespace

Primary tabs

Hi Guys,

I am trying to pull data from CacheDB and push into elasticsearch using logstash. In the configuration file i am giving the following. But it is throwing error No Suitable Driver Found for jdbc:Cache://ipaddress:port/namespace. Could anyone please help to resolve this ? I tried both JDK17 and JDK18 but no luck.

My Config file is as follows

 

input {
    jdbc {
    clean_run => true
    jdbc_driver_library => "C:\InterSystems\Cache\dev\java\lib\JDK17\cache-jdbc-2.0.0.jar"
    jdbc_driver_class => "com.intersys.jdbc.CacheDriver"
    jdbc_connection_string => "jdbc:Cache://Ipaddress:1972/PC61T"
    jdbc_user => "dialup"
    jdbc_password => "***"
    schedule => "* * * * *"
    statement => "SELECT * FROM AEADOCTOR "
    }
}
output {
elasticsearch {
    hosts => ["localhost:9200"]
    index => "cachesql"
}
stdout { codec => rubydebug }
}

 

Replies

Values looks correct (I assume Ipaddress is in fact replaced by an ip address or a hostname).

I think the issue is the access to the driver library.

Check that the user you're running the app has access.

Maybe you need to specify the path with double slashes.

Also try copying the jar file into your app directory.

On the other hand InterSystems offers a very flexible and powerful full text search solution, as a part of InterSystems Cache - iFind (Also known as InterSystems SQL Search for InterSystems IRIS). Try it out to add full text search to your application.

Hi Eduard Lebedyuk ,

Thanks for your quick response, i have given the correct Ipadress and portnumber(1972) where the CacheDB is installed. 

I have copied the .jar files into path where the logstash application is installed, also i tried with double slash as below, but no luck.

jdbc_driver_library => "D://EKL//logstash-7.7.0//JDK18//cache-jdbc-2.0.0.jar"

Regarding using iFind, we have other applications used ELK (Elasticsearch,Logstash,Kibana) for their logs, we would like to provide a generic solution which uses ELK

Anything else can i try ?

Thanks & Regards,

Sadagopan TS 

Having the jar in the same directory as the application may not be enough to ensure that the JAR is loaded into the vm.

How are you running the logstash application? Is it through a GUI or CLI? If CLI, can you paste (with any sensitive information redacted ofc) the command your running?

Hi Kevin,

Thanks for looking into this. I am using Character version of logstash. I am running the below command from Windows Command Prompt

D:\EKL\Conf>logstash -f cachesql.conf

content of cachesql.conf is below

input {
    jdbc {
    clean_run => true
    jdbc_driver_library => "D://EKL//logstash-7.7.0//JDK17//cache-jdbc-2.0.0.jar"
    jdbc_driver_class => "com.intersys.jdbc.CacheDriver"
    jdbc_connection_string => "jdbc:Cache://130.78.88.54:1972/PC61T"
    jdbc_user => "dialup"
    jdbc_password => "Banbury1"
    schedule => "* * * * *"
    statement => "SELECT * FROM AEADOCTOR "
    }
}
output {
elasticsearch {
    hosts => ["localhost:9200"]
    index => "cachesql"
}
stdout { codec => rubydebug }
}

Produced the below error

[2020-06-01T21:46:00,204][ERROR][logstash.inputs.jdbc     ][main][4a64f0663ba619
5668b7646c5df76a994f06d2a1987af2f0cfd9e6d43b7ff5f8] Unable to connect to databas
e. Tried 1 times {:error_message=>"Java::JavaSql::SQLException: No suitable driv
er found for jdbc:Cache://130.78.88.54:1972/PC61T"}

Java Version used

C:\Windows\system32>java -version
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment AdoptOpenJDK (build 14+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14+36, mixed mode, sharing)
 

Many Thanks 

Regards,

Sadagopan TS

Many Thanks Kevin, i am jumping in joy. I just copied the .jar file into the logstash Install Directory , Jars file folder it worked.

Thanks a ton for your help