Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cast PreparedStatement to org.gjt.mm.mysql.PreparedStatement

 
christine lorraine
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i want to use the getLastInsertID() of mmMysql Driver because
according to the author it is thread safe.
in the documentation it was stated that i need to cast my
prepared statement to org.gjt.mm.mysql.PreparedStatement inorder
to use this specific function.
how can i do it? i tried several statements but i can't get it right. pls. help. or if you have other suggestions on how to
retrieve the last inserted id considering the thread safetiness issues.. i will appreciate it very much.
thanks.
 
mibrahim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a simple cast does not work try creating a new org.gjt.mm.mysql.PreparedStatement object passing the PreparedStatement you already have, as an argument.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic