• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

define database connection

 
fang eve
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it better to write all the database url, username, path in the web.xml or create 1 java function for it?
[ June 22, 2006: Message edited by: fang eve ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Defining connection details in a suitable configuration file (possible web.xml) is usually better. That way you don't have to recompile your code to change databases.
 
fang eve
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh.. but as in security concern web.xml is better?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who has access to web.xml (or whatever configuration file you may choose)? In a properly secured application, only the administrator.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic