File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes How to secure the database credentials Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to secure the database credentials " Watch "How to secure the database credentials " New topic

How to secure the database credentials

IshwarJava Chand

Joined: Jul 04, 2007
Posts: 3
I do not want to put my database credentials information in properties and hibernate.cfg.xml file.
Can anyone suggest me that it is possible in hibernate to secure that credentials and if yes then how it can be achieved.

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Why not? Credentials have to go somewhere (not Hibernate's rules - just one of the the basic requirements for connecting to a database).

You could write your application to prompt for these, that way the would not be stored. Or you could swap to a database that support single sign on (DB2 or SQL Server for example).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Newton

Joined: Sep 29, 2008
Posts: 12617

Or use JNDI, and store them in another different place on the server.

But the basic point is sound--why do you care?
I agree. Here's the link:
subject: How to secure the database credentials
It's not a secret anymore!