|
-
May 13th, 2001, 11:27 AM
#1
Thread Starter
Addicted Member
Simple and Urgent: JDBC Question
Dear Friends,
If I use
Code:
query = "SELECT * FROM Officer WHERE OfficerID='" + OfficerID + "'";
rs = stmt.executeQuery(query);
to check whether the guy exists. IF not found, then I will return loginResult = 0.
But I am afriad of the undetermined result in rs. What's in rs if the OfficerID is not found? Is it null or "" or so? How should I write the following condition?
if ( ... )
loginResult = 0
else
loginResult = 1
-
May 13th, 2001, 11:32 AM
#2
Fanatic Member
Well, if rs is a string, you could try
if (rs.length() > 0) //or however long you need it
loginResult = 1;
else
loginResult = 0;
Alcohol & calculus don't mix.
Never drink & derive.
-
May 13th, 2001, 11:49 AM
#3
Thread Starter
Addicted Member
How to return an array of values from a method
Dear Friends,
How can I return more than one value back to the caller please?
Suppose I have to return an array of string from a method?
Thanks
-
May 17th, 2001, 02:57 PM
#4
Lively Member
hey cantene
the resultset should return set number values based on a query. In this case....you are returning 1 value and it is most likely int datatype. I have to double check on that, but I am pretty sure that is the int datatype. So in the case of the login check....if it does equal 1 then the person is logged in.
manoj
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|