There is a property file in which database name,user name,user password is saved.With the use of this file JDBC connection can be stablished with oracle.
//load a file that has all the information of database,user name,user password. //It will throw ClassNotFoundException if class is not found //If any exception due to database is occured then it throws SQLException String driverClass = "oracle.jdbc.driver.OracleDriver"; Connection con; public void init(FileInputStream fs) throws ClassNotFoundException, SQLException, FileNotFoundException, IOException { Properties props = new Properties(); props.load(fs); String url = props.getProperty("db.url"); String userName = props.getProperty("db.user"); String password = props.getProperty("db.password"); Class.forName(driverClass); con=DriverManager.getConnection(url, userName, password); }