not executed and control always reaches to 2nd if statement but this code works fine with MS-access databse..Please let me know where i am wrong..as you people always help me...please reply soon.i am learning java myself here is no one for help..ony ranchaers or sdn [ September 12, 2006: Message edited by: Bear Bibeault ]
If you use "select * from test1 where userid=?" you will either get a result or you won't. If you get a result then you can check the rest of the user credentials, if you don't get a result then they are not registered.
I would caution you to never do this, because your code will likely break the moment you change your database, AND it will be very hard to debug (which order were those fields in, again?) when something is not working.
Instead, specify your fields:
Some suggestions for your consideration: 1) Name your Primary Key as "id". Longer names become tedious when dealing with relationships (e.g., "WHERE foo.user_id = bar.payment_received_late_id AND abba.band_performer_id = venue.confirm_scheduled_bands_id" versus "WHERE foo.id = bar.id AND abba.id = venue.id").
2) Keep your field names all lowercase. Use underscore ("_") for word boundaries: user_name, personal_email, primary_job_title, etc. Some systems don't care about case, so changing to upper case for the field names is an extra step you'll have to remember (and believe me, you will forget it at least once).
3) Always alias your table and use it in the field list. This is a good habit to get into that will prevent problems later, especially when joining tables. (e.g., "SELECT f.id, b.first_name, a.income, ve.locaiton FROM fooboo f, barboo b, abba a, venue ve ..." )
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com