Results 1 to 2 of 2
  1. #1
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Post How to retrieve last inserted id from MS access 2003

    How to retrieve last inserted id from MS access 2003 in java
    Java Code:
    try(Statement st=con.createStatement();){
                int record = st.executeUpdate(query, Statement.RETURN_GENERATED_KEYS);
                ResultSet result = st.getGeneratedKeys();
                int row = 0;
                if (result.next()) {
    		row = result.getInt("sale_purchase_book_id");
    	    }
                if(result != null) result.close();
                
                return row;
    }
    im getting UnsupportedOperationException

    Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException

    please help me.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: How to retrieve last inserted id from MS access 2003

    Which means the driver you are using does not support that operation.
    I don't know if there are any Access drivers that do.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 0
    Last Post: 05-14-2012, 04:57 PM
  2. data not inserted in tables
    By me.anchit in forum Advanced Java
    Replies: 6
    Last Post: 09-30-2011, 03:02 PM
  3. Data not inserted into an object
    By LoViNgHeArTy in forum New To Java
    Replies: 11
    Last Post: 06-28-2011, 05:51 AM
  4. count inserted line in database
    By tedy2808 in forum New To Java
    Replies: 3
    Last Post: 08-16-2010, 10:57 AM
  5. Replies: 0
    Last Post: 07-29-2008, 01:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •