Jdbc driver mismatch

Asked by Tom

Hi,

This is not a question but rather to share a problem I ran into so others may find it helpful.

After I installed Stado, I wrote a java test program that connects to Stado server through jdbc. It seems Stado used to distribute postgres jdbc driver separately as many of its scripts includes "../lib/postgresql.jar" in the class path. But now Stado packs jdbc driver in the same stado.jar. So I download the most recent jdbc driver (9.1-901 JDBC 4) and it didn't work. I got following error when calling DriverManager.getConnection():

org.postgresql.util.PSQLException: Protocol error. Session setup failed.

It took a while for me to figure out it's due to Stado server is incompatible with latest jdbc driver. Once I downloaded an older version (9.0-802 JDBC 4) it worked. Hope you won't get stuck for the same cause as I did. :)

Question information

Language:
English Edit question
Status:
Solved
For:
Stado Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
Last query:
Last reply:
Revision history for this message
Tom (tdwang) said :
#1

Problem solved. See my original post.

Revision history for this message
Jim Mlodgenski (jim-cirrusql) said :
#2

Thanks Tom

We need to remove the postgresql.jar file all together so people don't run into this in the future

Revision history for this message
Tom (tdwang) said :
#3

Hi Jim,

I would think it should be the other way around. If you package postgresql.jar as a separate file in stado distribution, then app users can just copy that into their environment. Otherwise they would have to figure out which jdbc driver version to download in order to be compatible with stado server. That's what I ran into.