Registering Clickhouse DB Driver

Hey !

I’m currently trying to set up the Database connection between our Clickhouse DB and KNIME but I am unfortunately not able to register the driver via KNIME.
I’ve downloaded the JAR and when registering the driver I can’t click on OK as it’s greyed out.
I am also not able to select a driver class or use the “find the driver class” as it shows as empty.

Can anyone help me with this?

1 Like

Hi @Chaosprinzip

I’ve not used it, but I did try download clickhouse jdbc 0.3.1 to test this. It was packaged up in a jar_files.zip file. I extracted the files to a folder which I left as “jar_files”.

I then proceeded to do the same as you and try to add the jdbc jar file. Same result as you.

So I then removed that jar again from the dialog, and added the folder using Add directory, and then clicked Find driver classes…

Does that get you any further?

2 Likes

Hey @takbb thanks for the help!
It seems to have worked to register the driver - but now I get this:


I know that I had to enable SSL in DBeaver and I guess I need to do that here too. But how can I do that?

I don’t know the answer to this, but I’ve seen mentions for other databases of adding to the end of the database url, the following, or maybe Clickhouse has something similar:

?useSSL=true&requireSSL=true

(the intial ? might be an & instead, if there are already other parameters on the url).

e.g.

Does that help?

2 Likes

Hello @Chaosprinzip,

custom JDBC driver connection parameters can be defined under JDBC Parameters tab of connection node. Check this part of Database guide for more:
https://docs.knime.com/latest/db_extension_guide/index.html#advanced_options

Br,
Ivan

2 Likes

Thanks @ipazin ! That worked.
Unfortunately now I am receiving the next error : Error 159 (Read Timeout) for the DB - is there a way I can increase the timeout time ?

1 Like

Hi @Chaosprinzip

Perhaps the info here is of use

1 Like

Hey @takbb ,
Yea that’s what I found too but I’m not sure where I can change the timeout settings in KNIME. Do you have any knowledge about that?

I don’t really, and I don’t have a Clickhouse database to try it on, but my guess would be the JDBC parameters tab on the DB Connector.

Assuming that you can get some queries to work without timing out, I’d probably use a working query to test it. Find something that takes maybe 5 seconds to return, and set the value to something really low (zero maybe) and see if it then fails. At least this might give a clue if the parameter is having any effect. If it does, then try setting it really high so that your failing query starts to work.

I’m guessing at the parameter name (based on the stack overflow comment)

By the way, the defaults mentioned on Stack Overflow are according to some 30 seconds, and according to others 300 seconds. I assume the setting is in milliseconds, so the screenshot would set to 300 seconds, or 5 minutes.

How quickly are you getting the timeout message?

1 Like

I’m getting the timeout after probably 15-30 seconds. To be honest I didn’t really stop the time till now :slight_smile:
The connection per se is definitely working as there are indeed smaller tables that are accessible to me. So I hope setting up the timeout works. (It worked in DBeaver at least)

Thanks for your help again! And let’s hope this is going to work. I have to say - I really don’t like Clickhouse haha.

Hello @Chaosprinzip,

glad to see you managed to connect :slight_smile:

Any custom JDBC connection parameter can be defined under above mentioned JDBC Parameters tab. You just need to write correct parameter name and value which depends on database and driver version you are using. From experience it’s best to have driver documentation close by :wink:

Br,
Ivan

1 Like

Thanks @ipazin and @takbb !
It works know :slight_smile:

2 Likes

That’s excellent @Chaosprinzip. Glad it worked. And thank you for confirming the solution.

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