Re: ID of last insert from DB2 table

From: Dundonald (mark.dundon_at_gmail.com)
Date: 01/20/05

  • Next message: Juha Laiho: "Re: Oracle JDBC Driver ps.setTimestamp() slows down query execution many times"
    Date: 20 Jan 2005 06:26:33 -0800
    
    

    mark.dun...@gmail.com wrote:
    > I may have to migrate the database a Java application uses from MySQL
    > to DB2. I am currently assessing the impact. One item I'm currently
    > looking at is that of obtaining the ID of an insert immediately after
    > the operation.
    >
    > For example with the MySQL database I would perform the following
    > command:
    >
    > long lastInsertedID =
    > ((com.mysql.jdbc.Statement)statement).getLastInsertID();
    >
    > The statement variable is of type java.sql.Statement.
    >
    > If I port over to DB2 I am concerned I cannot replace this
    > functionality. A method such as .getLastInsertID() is not available
    > from java.sql.Statement.
    >
    > Is there a solution if I port to DB2?

    Apologies. I originally posted this to .programmer when I should have
    posted to .databases.

    Any ideas anyone please?


  • Next message: Juha Laiho: "Re: Oracle JDBC Driver ps.setTimestamp() slows down query execution many times"

    Relevant Pages

    • Re: [SLE] I HAD IT WORKING! MySQL under SuSE 9.0 Woes
      ... > port       = 3306 ... # The following options will be passed to all MySQL clients ... socket      = /var/lib/mysql/mysql.sock ... All this does is prevent you from deleting a critical database accidentally. ...
      (SuSE)
    • Re: ID of last insert from DB2 table
      ... > I may have to migrate the database a Java application uses from MySQL ... > to DB2. ... > Is there a solution if I port to DB2? ...
      (comp.lang.java.programmer)
    • Re: Access DB2 From Linux
      ... pull data from tables in DB2 and put them into a MySql database. ...
      (comp.sys.ibm.as400.misc)
    • Access DB2 From Linux
      ... Is there a way to get a shell similar to the one that you get by ... pull data from tables in DB2 and put them into a MySql database. ...
      (comp.sys.ibm.as400.misc)
    • Re: ID of last insert from DB2 table
      ... >> to DB2. ... >> For example with the MySQL database I would perform the following ... >> Is there a solution if I port to DB2? ...
      (comp.lang.java.databases)