This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

MySQL JDBC Error

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is returned by res.getString("user_name") on line 15?

If null, SQL Error is expected result.
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement "res.next();" may throw SQLError if the resultset is empty!
 
    Bookmark Topic Watch Topic
  • New Topic