Alec,

Thanks for the info, however I'm struggling to understand how it applies to
my case. Following is the piece of code in question, and the error is due to
the SELECT following the INSERT (insert works fine; LIGHTBOX_ID is on
AUTO_INCREMENT) :

// add a LIGHTBOX row ...
rs = stmt.executeQuery("INSERT INTO LIGHTBOX (CLIENT_ID,
    LIGHTBOX_ID, NAME, TS, IMAGE_COUNT) VALUES ('" + (String)
    session.getValue("clientID") + "', 0, '" +
    req.getParameter("lb_name").trim() + "', NULL, '" +
    sessionLightbox.getNumOfImages() + "')");

// get the LIGHTBOX_ID value just assigned ...
rs = stmt.executeQuery("SELECT LAST_INSERT_ID() AS ID");
int iNextId = rs.getInt("ID");

Basically I'm not traversing any returned sets here, just inserted a row,
determining an allocated ID and would be (!) carrying on inserting into
another table.

Is there a 'de-facto' reference JDBC driver I should try / use ?

Any info you may have would be good news !

Regards,

David


> 
> In JDBC2.0, you can move the invisible pointer witing your ResultSet
> backwards and forward, or to absolute row numbers. You can therefore move
> the pointer completely out of the table - fro wxample, by calling
> ResultSet.beforeFirst(). If you then attempt to access the "current" row,
> you will get this error.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php   (the manual)
> http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to