• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Swing connection to Oracle database

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic