• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL statements

 
vasu narayana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
difference between executeUpdate() and executeQuery() and what are the
JDBC exception?
 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If you are working with insert, delete and update sql statement which returns the count, you would be working with executeupdate(). Mostly all DML statements.

If you are working with select sql statement, which returns resultset, you would be working with executeQuery().

Both of them throw SQLException.

Let me know if i am wrong.

Regards
Makarand Parab
 
vasu narayana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for ur reply.. i had cleared abt diff b/w executeUpdate n execute query .. one more question is .. tell me the jdbc exception types
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your first question, you should have read the docs.
Now, please read the docs. There is no other better substitute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic