List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 10 2002 9:42pm
Subject:Re: why null being returned
View as plain text  
At 8:17 -0700 5/10/02, Lalit Nagpal wrote:
>through a servlet i insert my form data into my table
>(primary key is auto-incremented) and then i throw
>another query which is
>select last_insert_id() from mytable limit 1
>through my <statement>.executeQuery method. when i ask
>for the data through
><myresultset>.getString(1) i get null
>NullPointerException
>why ... any ideas ... i welcome your suggestions
>friends.
>
># Lalit Nagpal #

I don't know why you're getting a null pointer exception, but your
second query should be just:

SELECT LAST_INSERT_ID()

And maybe you want to invoke getInt() instead of getString()?
Thread
why null being returnedLalit Nagpal10 May
  • Re: why null being returnedPaul DuBois10 May
RE: why null being returnedAaron Rutledge10 May