Login page user name and password for Oracle Database

Hi,

I created a login.jsp page with username,password and a submit button. How can I validate this username and password from my Oracle database username and password?

I am using NetBeans5.5 with Tomcat5.5.17. Right now I have hardcoded username and password in my persistence.xml.

Anyhelp?

[316 byte] By [AlexCoxwella] at [2007-11-27 1:40:14]
# 1
> How can I validate this username and password from my Oracle database > username and password? What's the exact problem/question?
BalusCa at 2007-7-12 0:54:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thnx BalusC for ur reply. Let me explain my issue.

I have created a login page. and user is able to enter user name and passowrd on this page. User is supposed to press a 'submit' button when user enters username and password to connect to database. What should I write in 'submit' button's action to let user allow to proceed if username and password are correct i.e. username and password of my oracle database. (usename=scott and passowrd=tiger).

plz help.

AlexCoxwella at 2007-7-12 0:54:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Pseudocode:

1) User user = SELECT * FROM users WHERE username.

2) if (user == null) set error "You are not registered." and exit.

3) if (!user.getPassword().equals(enteredPassword)) set error "Invalid password." and exit.

4) No errors and anything OK? Proceed.

This article might contain interesting material: http://balusc.xs4all.nl/srv/dev-jep-usf.html

BalusCa at 2007-7-12 0:54:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...