For example:
FileInputStream fis=new FileInputStream ("db.prop");
For example:
Properties p=new Properties ();
For example:
p.load (fis);
public Object get (String); public Object getProperty (String);
Here, String represents property name or key name.
For example:
String dname= (String) p.get ("Dname"); String url= (String) p.get ("URL"); String username= (String) p.get ("Uname"); String password= (String) p.get ("Pwd"); String table= (String) p.get ("Tablename");
Here, Dname, URL, Uname, Pwd and Tablename are the property names present in resource bundle file. dname, url, username, password and table are the property values present in resource bundle file.
Write a java program which illustrates the concept of resource bundle file or how to develop a flexible jdbc application along with its metadata?
Answer:
rbfdb.prop:
Dname=oracle.jdbc.driver.OracleDriver URL=jdbc:oracle:thin:@127.0.0.1:1521:oradsn Uname=scott Pwd=tiger Tablename=student