Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help Re: getLastInsertId()  RSS feed

 
Sanz Joanne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Please Please can somebody help me, this problem is driving me up the wall. I'm developing a shopping cart using JSP and the example uses mysql but i'm actually using a sybase Database and i can't seem to figure out the alternative code for this statement:
long order_id = ((org.gjt.mm.mysql.PreparedStatement)Stmt).getLastInsertID();
If someone could help i'd really appreciate it
Thanks a mill,
Sanz
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manage the sequence separate to your sql statement. ie get the next id, then insert.
I don't use 'get last insert id', I don't like it.
Dave
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!