• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to hide my connection details from diff clients in hibernate configuration file

 
rajesh vasireddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I developed a standalone application which uses hibernate for its persistance logic and uses mysql database on php server hosting.
as we know hibernate logic is with my standalone app at client side.
So now i want to run that app on multiple machines.

In hibernate we write configuration file in which we should give connection url as property along with username and password of database.
So is there any way that i can hide this configuration file and still make my hibernate app work on multiple systems.

Since all can see my hibernate configuration file so anyone can use my database details and get access.

please hepl me out.
Thanks in advance.

 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can delete those entries from the xml and pass them to hibernate after configuration like:
 
rajesh vasireddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manuel Petermann wrote:You can delete those entries from the xml and pass them to hibernate after configuration like:


Here what is this "uData", is it a POJO class with static methods?
I am sorry i am new so please explain little more closely.
Thanks for the help.
 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad, i should have modified it a bit more to make it clearer. I grab the user credentials from a login screen and store them in an object which is given to my hibernate SessionBuilder facory.
Those are just two Strings.
You need to be a bit creative to catch the exception if the password or username are wrong though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic