aspose file tools
The moose likes Java in General and the fly likes how to retrieve from .properties file using java.util package Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to retrieve from .properties file using java.util package" Watch "how to retrieve from .properties file using java.util package" New topic
Author

how to retrieve from .properties file using java.util package

rajesh mara
Greenhorn

Joined: Nov 30, 2006
Posts: 11
i have stored all sql statements in sql.properties
(for example: retrieve =" select * from emp")

how can i retrieve this statements from sql.properties using java.util package can please anyone send me the code how to get from sql.properties
Jeremy Botha
Ranch Hand

Joined: Feb 16, 2005
Posts: 125
why java.util specifically?

J
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3327

explore java.util.Properties class and its associated APIs. you will get it.

Try googling for sample programs for the same.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Kiran Jakkaraju
Greenhorn

Joined: Jun 05, 2007
Posts: 2
Hi,

If you have "MyResources.properties",

and the above file has


"KEY_WORD= xyz"

To retrieve the KEY_WORD in your java file is:

//initiate the Resource Bundle, and get the properties file.
ResourceBundle myResources =
ResourceBundle.getBundle("MyResources");

//get the keyword
myResources.getString("KEY_WORD")


Kiran Jakkaraju<br />email: kiran.jakkaraju@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retrieve from .properties file using java.util package
 
Similar Threads
difference
limitation of retrieving the records from the database
How to write SQL query with multiple search condition in IBM WACs
How to sort Map?
What causes this error in the Junit test?