JSP/Servlets: Where should the password be stored?

R

Ramon

Hi,

I am doing an experimental project (using JSP) where I am implementing a
fictional holiday booking system. Details about the users (admins and
customers) and holidays are stored in a DB (using MySQL).

I am currently saving the user details (username, password and if the
user is an admin) in a table. In order to verify if the user's login is
correct, the system needs to go to the DB and check in the appropriate
table. In order to do this operation, I have created an DB account
(named it dbuser) which has the rights to (at least) read the users
table...etc.

My question:
Where should the password of this account (i.e dbuser) be stored?
(Currently it is hard-coded in a Java Bean, which is not the best way to
do so... BTW the users' passwords in the table are hashed. I
appreciate any suggestion).

Thanks.
 
A

Arne Vajhøj

Ramon said:
I am doing an experimental project (using JSP) where I am implementing a
fictional holiday booking system. Details about the users (admins and
customers) and holidays are stored in a DB (using MySQL).

I am currently saving the user details (username, password and if the
user is an admin) in a table. In order to verify if the user's login is
correct, the system needs to go to the DB and check in the appropriate
table. In order to do this operation, I have created an DB account
(named it dbuser) which has the rights to (at least) read the users
table...etc.

My question:
Where should the password of this account (i.e dbuser) be stored?
(Currently it is hard-coded in a Java Bean, which is not the best way to
do so... BTW the users' passwords in the table are hashed. I
appreciate any suggestion).

You should be using a connection pool.

And database username/password is stored with the connection
pool definition - in Tomcat typical in conf/server.xml !

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top