I wrote a program to connect to Progress database using JDBC.
I wrote code in Eclipse and I am trying to read dabase properties from a file stored in C:\ drive as database.properties?
but when I try to connect to the database using the program, it displays
Error:
Caused by: java.lang.ClassNotfoundException: com.progress.sql.jdbc.JdbcProgressDriver?
I think this might be because I dont have a plugin installed for Progress in Eclipse? Can you provide me the adress where I can download the plugin or jar file ? where should I store the file?
Here is a snapshot of the code I am using to connect to database along with the properties file:
database.properties
qad.proxy.db.driver=com.progress.sql.jdbc.JdbcProgressDriver
qad.proxy.db.url=jdbc:JdbcProgress:T:qad1.atcc.org:16600:prodproxy
qad.proxy.db.user=xxxxxx
qad.proxy.db.password=yyyyyyy
Code to connect to this file:-
private Connection connectToDatabase(String name) throws ErpProxyDaoException, SQLException{
String driver = null;
String url = null;
String userName = null;
String password = null;
try{
Properties inProps = new Properties();
FileInputStream in = new FileInputStream("C:\\database.properties");
if (in == null) {
throw new IOException("C:\\database.properties" + " unable to read");
} else {
inProps.load(in);
driver = inProps.getProperty("qad." + name + ".db.driver");
url = inProps.getProperty("qad." + name + ".db.url");
userName = inProps.getProperty("qad." + name + ".db.user");
password = inProps.getProperty("qad." + name + ".db.password");
ErpProxyProgressDAO.logger.info("url = " + url + " username = " + userName + " for db " + name);
}
Class.forName(driver);
Connection connection = DriverManager.getConnection(url, userName, password);
ErpProxyProgressDAO.logger.fine("Got connection ..." + connection);
return connection;
} catch (ClassNotFoundException e) {
throw new ErpProxyDaoException("Error loading driver ", e);
} catch (IOException e) {
throw new ErpProxyDaoException("C:\\database.properties" + " unable to read");
}
}