| Author |
With out using resultset..?
|
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
|
|
Dear all
Is is possible to know where the record exists in DataBase for a preticular condition with out using Result set object
For Ex:- iwant to check the userid in database so that i will check in database and using result set i will forward my logic .
|
Creativity is nothing but Breaking Rules
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
|
|
ResultSet is the interface to retrieve answers from your database.
Is there a reason why you can't use it for this purpose?
|
OCUP UML fundamental
ITIL foundation
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
Santhosh, you might want to get someone to help you to phrase that question a little more understandably.
I think what you're trying to do is the common case where you want to see if a user is defined in a database, but you do not actually want to retrieve any of the user data. The SQL version of that would be:
Or, if you're doing a login check:
These queries do return a result set, but it has only one row and one column, and its value is either 1 (user exists, password valid) or 0 (user does not exist, or password is invalid).
So, while you need a ResultSet, the logic isn't all that complicated and the overhead is pretty low:
This code won't execute - I've done some simplifications to illustrate the concept, but it's basically how you'd do something like that.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: With out using resultset..?
|
|
|