Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exact differenece ??

 
Amit Kumar S
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between executeQuery() and executeUpdate()
I mean what database operations possible in both the cases ?
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Javadoc is enough to explain the difference !!

See this !
 
Scott Selikoff
author
Saloon Keeper
Posts: 4007
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically speaking: you can execute whatever you want. JDBC will not validate your queries. The general rule of thumb though is to use executeQuery for SELECT statements and executeUpdate for INSERT/UPDATE statements. Also, look at the return value of each in the API as Sagar suggested.
[ July 01, 2008: Message edited by: Scott Selikoff ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic