i have a jsp page that has an mysql command.when i try the command in mysql it works perfectly.when i try it out with my project it just doesnt send the right data.. in specific my mysql command finds a customer id using validation with username and password. in mysql window as i said previously it works fine when i run from my project it brings no data....
Can't see the database connection code you have (whatever is in that class Conne), so can't confirm if it works or not. Assuming it does work though...
The problem is, you haven't called rs.next(). When you first retrieve a result set it is pointing at nothing. You have to call rs.next() to navigate to the first record (if any). rs.next() returns false if there is no next record.
So your code
Whole lot of other things wrong with this code in my opinion.
Connecting to the database as part of the init() method is a wasteful approach. Each individual servlet in your application will have its own DBConnection - and it never gets released! Connections should be got on a per request basis from a Connection Pool
Naming conventions/Coding standards Variables should be names with camel case (start with lower case letter rather than upper case letter). I would refer you to Java coding conventions
Why are you using a String "true"/"false" instead of a boolean variable?
You need to close your resultset/statement objects (preferably in a finally clause)
Connecting to the database as part of the init() method is a wasteful approach. Each individual servlet in your application will have its own DBConnection - and it never gets released!
Worse still, you'll probably find that after 8 hours of inactivity, the next request will throw an IOException and all subsequent requests fail. This is because MySQL has a timeout of (by default) 8 hours on all connections.
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
thnx found out what was wrong. im not familiar with the connection pool but will find out and fix that.didnt know that about the connections.i thought that after the servlet was not used any more it closed the connection. the naming was just temp.naming is one of the basivs that i think i can handle. thnx again...