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 SQL statements 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 "SQL statements" Watch "SQL statements" New topic
Author

SQL statements

vasu narayana
Greenhorn

Joined: Oct 31, 2005
Posts: 3
difference between executeUpdate() and executeQuery() and what are the
JDBC exception?


regards<br /> vasu
Makarand Parab
Ranch Hand

Joined: Dec 10, 2004
Posts: 121
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

Joined: Oct 31, 2005
Posts: 3
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

Joined: Aug 15, 2004
Posts: 2874
For your first question, you should have read the docs.
Now, please read the docs. There is no other better substitute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL statements