This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes MySQL JDBC Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL JDBC Error" Watch "MySQL JDBC Error" New topic
Author

MySQL JDBC Error

krishan go
Greenhorn

Joined: May 20, 2011
Posts: 8
This is a simple program where i create two tables in a database using jdbc and sql.



on executing the code i get an "SQL ERROR" from the catch block.on further investigation i see that the error is from the /*error line*/ which i marked. what am i doing wrong???

-krishan


Moderator comment: I have edited your post to add code tags and to apply proper indenting..
They make your code more readable.
Please use code tags around your code for your future posts.
Andrey Kozhanov
Ranch Hand

Joined: Mar 12, 2010
Posts: 79
What is returned by res.getString("user_name") on line 15?

If null, SQL Error is expected result.
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

The statement "res.next();" may throw SQLError if the resultset is empty!


S.D. MADHAN
Not many get the right opportunity !
 
 
subject: MySQL JDBC Error
 
Similar Threads
jdbc program written in Eclipse3.2.1 to connect DB2
JDBC - Retriving data from Database
jdbc programm connecting DB2, error thrown in cmd as "null user id is not supported"
connecting java application to JAVADB database
jdbc connection to ms sql (urgent)