Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / December 2004

Tip: Looking for answers? Try searching our database.

Servlets and JDBC

Thread view: 
Xarky - 12 Dec 2004 09:44 GMT
Hi,

A null pointer exception is being given on this line
    while (result.next())

I am trying to add an if statment but the compiler is reporting an error.

if (result.next() == null)

operator == cannot be applied to boolean,<nulltype
Dieter Bender - 12 Dec 2004 10:08 GMT
Hi,

if (result == null) should work

Dieter

> Hi,
>
[quoted text clipped - 6 lines]
>
> operator == cannot be applied to boolean,<nulltype
Juha Laiho - 12 Dec 2004 16:32 GMT
bernardpace@yahoo.com (Xarky) said:
>A null pointer exception is being given on this line
>    while (result.next())

From the context you can tell that next() returns a boolean, so the return
value cannot be null. This leaves only result as suspect. Why is result
null when you're entering that line?
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.