Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Swing connection to Oracle database

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,
I'm using Java Swing and Oracle Database at present for doing a project. But in each and every java file i want to add database connection parameters.

Is that possible to use a particular file to store the username and password and also the DbConnection details so that i can include that file in all the pages.

If my client asks for another database, so that i don't want to change the code in whole pages, else change the particular file


My Question is

If I put username and password in a particular file..
How can i include that file in each java file where i call the database connection.


Please help me ranchers..

Thanks in advance

regards
Aravind Prasad
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could just use a Properites file and refer to each connection parameter by its property name. That would remove the need to hardcode your connection details.
[ January 11, 2007: Message edited by: Paul Sturrock ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to this [ UD: removed links to copyrighted material ]


hope it helps..
[ August 03, 2007: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic