Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

noob question about database settings  RSS feed

 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks

I am trying to migrate and old .jsp site to a new server.

I'm wondering if there is a usual of defaul place where databse user and passwords are kept when setting up a site in jsp.

For example, one of the apps I am porting over has a .properties file, this has the user and pass for a database it talks to.

Is it standard to have one file that holds the database user info? Or could it be in .class file somewhere?

Anytips or hints would be appreciated.

I realize its a random question, and proably un answerable, but if anyone could just say "did you look in....." that would be great
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That greatly depends on what's powering your backend. If you are using Hibernate, for example, credentials never even smell the front end.

Hard-coding them into a class is certainly not appropriate in any scenario that I can think of.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The closest thing to a "default place" would have to be the container managed connection pooling offered by the servlet spec.

If used, the Java code in your app will be portable across all compliant containers.
The actual configuration, however, will vary from container to container.

If you're not using this, there really is no standard place for such things.
You would have to describe what the old app was doing for anyone to be able to help you with migrating it.
 
michael white
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its just a web site.

theres a WEB-INF directory with.....

ahh, I just found it, JOY, its a Init.java file and has all the database info!! I guess that means that this info is in .class file some then...

Thanks for the reply's folks!!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!