Sello,
what is usually do is to create an SQL statement that goes something like:
"SELECT * from usertable where username=theEncodedUsernameHere and password
= theEncodedPasswordHere"
Then create a ResultSet that executes the said statement above.
After that check your ResultSet if it is not null (this means you have an
existing user with the username and password that he encoded. this is done
via the statement:
if (ResultSetObject.next()){
//your code here}
else { //throw an error message here }
hope this one helps..
Joy
>From: Sello Mathibe <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Querying a Database in JSP.
>Date: Fri, 9 Feb 2001 12:03:13 +0200
>
> > Hi. I've created a JSP login page where I've got a Username field and a
> > Password field. I've created a table in my Access database, I've also
> > created a DSN and can connect to it in my BEAN. Now my problem is that:
>I
> > want to check if the user/client has entered some data on both fields,
>if
> > he submit before he enters some data, I want to through an error message
> > or alert in JavaScript. If something is entered on both fields, I want
>to
> > validate that data from the database through the bean.
> >
> > Can somebody help me cause, I'm trying to create a huge application, but
> > I'm stuck at the beginning!
> > Thank You
> > Oscar
>###########################################
>
>This message has been scanned by F-Secure Anti-Virus for Microsoft
>Exchange.
>For more information, connect to http://www.F-Secure.com/
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets