zondag 3 februari 2013

hsqldb dbcp Connection is broken java.sql.SQLException

Problem Description

This just bugged me for a while. When trying to get connected to a locally running hsqldb server from a minimal spring mvc project I got this java.sql.SQLException; Connection is broken connection. Above all I could properly connect using squirrel so I knew the parameters were right.

Root Cause

Eventually it was an answer in this thread that made me check the hsqldb versions I was using. Since I knew I was using the lib from the same server within squirrel but another one from maven in the spring project this sounded very plausible.

Solution

And yes if you add a dependency for hsqldb instead of org.hsqldb you get an older version. So quickly changed this dependency in my pom file


       
            hsqldb
            hsqldb
            LATEST
       

to this one



       
            org.hsqldb
            hsqldb
            2.2.9
       


And that perfectly solved the issue. Good lock to everyone who got here (since that's probably not by searching the web for "funny kittens")!

Related Resources

http://www.techcrony.info/2009/06/02/admin/hsqldb-javasqlsqlexception-access-is-denied-in-statement-select-from-tbale/
http://sourceforge.net/projects/hsqldb/forums/forum/73673/topic/5294899
http://blog.gmane.org/gmane.comp.java.hsqldb.user/month=20090701
http://mvnrepository.com/artifact/hsqldb/hsqldb/1.8.0.10
http://mvnrepository.com/artifact/org.hsqldb/hsqldb/2.2.9