This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insert and preparedStatement

 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using this code:

but i get an error:
java.sql.SQLException: Can not issue data manipulation statements with executeQuery().

is it not possible to use my insert sql with '?' and preparedstatements?

TiA
 
Paul Clapham
Sheriff
Pie
Posts: 20184
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it is possible. But (as the error message says) you cannot use the executeQuery() method to do that. You should use the executeUpdate() method instead.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
executeUpdate() is the one ;)
thanks, Paul
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic