aspose file tools*
The moose likes Beginning Java and the fly likes Properties File reading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Properties File reading" Watch "Properties File reading" New topic
Author

Properties File reading

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Dear Ranchers,
I'm doing a project in JSP and MySQL. For the JSP-MySQL connection , I'm now writing the connection statments in each and every time when I want to insert,delete, update of select the database queries. If I change the MySQL root password, it will affect the coding completely.. So Instead of that I want to put properties file to store the

MySQL database
Username
Password

Please help me by sending some links where I can read and master about Properties file.

Regards

Aravind Prasad
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

Aravind,

I think the Java in General (beginner) is more appropriate for questions on the use of property files.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
You might start by reading Java Tutorial: Properties.


Ping & DNS - updated with new look and Ping home screen widget
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'm now writing the connection statements in each and every time when I want to insert, delete, update or select

I bet that's getting old, isn't it? One good guideline in OO design is to avoid duplication, which among other things means any copy paste is suspect. Are you comfortable making your own new classes? Think about a little class that does the connection work for you. It can read the configuration once, and remember it all day long.

If that much sounds worth doing, show us what you make and we'll talk about adding more nifty features.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Properties File reading
 
Similar Threads
reading properties to get connection
how to access db.properties file properties in hibernate.cfg.xml file
Properties File reading
Communications link failure Last packet sent to the server was 0 ms ago
Tomcat realms