To : Deepak
Hi.
This bit of code works for me......
String query = "SELECT * FROM MYTABLE" ;
String verytempstring ;
ResultSet rs = stmt.executeQuery(query) ;
while (rs.next()) {
verytempstring = rs.getString("REC_NAME") ;
}
if(verytempstring == null) {
Do some bit of code if it equals NULL ;
}
Hope this helps...
Keith
---------------------------------------------------------------------------
Keith Ball - Praktikant
AF12 Operationelle Analysen Luftwaffe
IABG MbH Einsteinstr. 20 85521 Ottobrunn
Phone : 0049-89-6088-2556
Email : [EMAIL PROTECTED] WWW site : www.iabg.de
----------------------------------------------------------------------------
----- Original Message -----
From: Deepak Patil <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 01, 1999 10:08 AM
Subject: how to check whether a column value is null in a database table
> Hi
> I am using
> rs.getString(1)
> for getting a 1st columns value of a database table, I want to check
whether
> the value is null or not, because if I use it without checking whether it
is
> null or not it gives me a runtime NullPointerException....
>
> how can I check for nulity
>
> Deepak
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html