Unrelated to the question: Why you execute two SELECT statements which you don't seems to use the results for anything? And why you use jdbc/odbc driver here?
Is there any other errors in the stack trace (full stack trace)? I suggest you test with only one statement against database and see what happens.