dcsimg
what's the return type, if no query results exists.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ashok_Dinasarapu
Posted On:   Thursday, December 4, 2008 07:05 PM

Hi FRIENDS,

I am new to JDBC.

I have one table with two columns

			
Table1:
...................
id_one id_two
...................
A21 1
A22 2
A23 3
..................

SELECT id_one FROM Table1 WHERE id_rwo = 5;

What's the result? is it null or any?? can we compare the result with null?

Thanks,

Re: what's the return type, if no query results exists.

Posted By:   Robert_Lybarger  
Posted On:   Saturday, December 6, 2008 10:20 AM

I believe you should get an empty ResultSet object. That is, it will be non-null but calling "next()" will immediately return false. (and result set metadata, if available, would show 0 rows). Provided the query is valid (table and cols exist) there is no reason to return "null".
About | Sitemap | Contact