List:General Discussion« Previous MessageNext Message »
From:Aaron Rutledge Date:May 10 2002 9:53pm
Subject:RE: why null being returned
View as plain text  
I've had simmilar problems. 
I had something like this...
String blah = myResultSet.getString("BLAHBLAH");
if(blah.equals("something)){ ...boom nullPointer exception

I'm not sure why the null value wasn't caught by wasNull(). Anyway I
worked around it by adding an if(blah!=null){ before I used any string
methods such as the equals().  Hope this helps.  If anyone else can
provide an explaination I would be grateful.

-----Original Message-----
From: Paul DuBois [mailto:paul@stripped]
Sent: Friday, May 10, 2002 3:43 PM
To: Lalit Nagpal; mysql@stripped
Subject: Re: why null being returned

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
>why ... any ideas ... i welcome your suggestions
># Lalit Nagpal #

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


And maybe you want to invoke getInt() instead of getString()?

Before posting, please check:   (the manual)           (the list archive)

To request this thread, e-mail <mysql-thread108677@stripped>
To unsubscribe, e-mail
Trouble unsubscribing? Try:

why null being returnedLalit Nagpal10 May
  • Re: why null being returnedPaul DuBois10 May
RE: why null being returnedAaron Rutledge10 May