Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exact differenece ??

 
Amit Kumar S
Greenhorn
Posts: 3
  • 0
  • 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: 2904
1
Java Spring Ubuntu
  • 0
  • 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: 3890
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • 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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic