This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Starter Question.

 
rama murthy
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the following statements correct.


For DML (Data Manipulation Language) statements like update, insert, delete we use the method executeUpdate.

For select statement we use executeQuery which returns a ResultSet instance.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sort of yes.

There are times and ways you could use execute() instead, but for beginners (and for most of general purpose code), that's the way to do it.

Beginners should also start with using PreparedStatement, instead of Statement. Many people have the idea that Statement is easier, and therefore should be learned first, but Statement has all sorts of problems and really shouldn't be used much at all...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic