Re: Newbie Blues : Unable to connect to derby database using JDBC

2007-11-16 Thread Thomas Nielsen
Bernts point is still very valid - you should catch Exception, not Throwable. My bad! catch (Exception e) { System.out.println(exception thrown:); e.printStackTrace(); } BR Thomas off to get more liquid Java... Bernt M. Johnsen wrote: Sorry, this one was intended only

Re: Newbie Blues : Unable to connect to derby database using JDBC

2007-11-16 Thread Jørgen Løland
One more thing... Your query SELECT firstname, lastname FROM USERS WHERE uid = 1001 will never return more than one row since uid is primary key. Hence, the SimpleApp1 code will throw an exception on line 73 even if you change the query as suggested in the previous comment. I wonder if you

Re: Newbie Blues : Unable to connect to derby database using JDBC

2007-11-15 Thread Øystein Grøvlen
Aneez, Can you provide the call stack for the exception you get? -- Øystein Aneez Backer wrote: Hi Am trying to connect to derby database, but have not been successful. I have created a database called 24k , and have also populated the tables Here's the code:

Newbie Blues : Unable to connect to derby database using JDBC

2007-11-15 Thread Aneez Backer
Hi Am trying to connect to derby database, but have not been successful. I have created a database called 24k , and have also populated the tables Here's the code: - org.apache.derby.jdbc.EmbeddedSimpleDataSource ds = null; Connection conn = null;

Re: Newbie Blues : Unable to connect to derby database using JDBC

2007-11-15 Thread Aneez Backer
Hi This is what is being printed on the console. The error message is in bold Loaded the appropriate driver. Connected to database 24k exception thrown: java.sql.SQLDataException: Invalid character string format for type int. The catch statement is as follows:- catch (Throwable e)

Re: Newbie Blues : Unable to connect to derby database using JDBC

2007-11-15 Thread Thomas Nielsen
It would probably be better to simply do catch (Throwable e) { System.out.println(exception thrown:); e.printStackTrace(); } to get the full stacktrace for the SQLException that you see as well. And just for the record, what version of derby are you using ? BR, Thomas