- This topic has 2 replies, 2 voices, and was last updated 16 years, 1 month ago by muddu_shafi.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
muddu_shafiMemberI have a program trying to connect to the progress database
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"); ErpProxyMockDao.logger.info("url = " + url + " username = " + userName + " for db " + name); } logger.info("before loading the driver: " + driver); logger.info("the database I'm connecting to is : " + url); Class.forName(driver); logger.info("after loading the driver: " + driver); Connection connection = DriverManager.getConnection(url, userName, password); [quote]Here is the statement where eroor appears ErpProxyMockDao.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"); } }
I have added progress.jar, jdbc.jar and procli.dll files to the project buildpath. They are added using Add extermal jars in the libraries tab and then ckecking it in the order/export tab.
Can anyone give me possible solution.
Stack trace:-
org.atcc.erpproxy.services.dao.ErpProxyDaoException: org.atcc.erpproxy.services.dao.ErpProxyDaoException: Error loading driver at org.atcc.erpproxy.services.dao.mock.ErpProxyMockDao.getCountries(ErpProxyMockDao.java:2477) at org.atcc.erpproxy.services.ErpProxyServices.getCountries(ErpProxyServices.java:491) at org.atcc.erpproxy.services.ErpProxyServicesTest.testGetCountries(ErpProxyServicesTest.java:481) Caused by: org.atcc.erpproxy.services.dao.ErpProxyDaoException: Error loading driver at org.atcc.erpproxy.services.dao.mock.ErpProxyMockDao.connectToDatabase(ErpProxyMockDao.java:227) at org.atcc.erpproxy.services.dao.mock.ErpProxyMockDao.getProxyDbConnection(ErpProxyMockDao.java:130) at org.atcc.erpproxy.services.dao.mock.ErpProxyMockDao.getCountries(ErpProxyMockDao.java:2467) ... 28 more Caused by: java.lang.ClassNotFoundException: com.progress.sql.jdbc.JdbcProgressDriver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.atcc.erpproxy.services.dao.mock.ErpProxyMockDao.connectToDatabase(ErpProxyMockDao.java:221) ... 30 more
Loyal WaterMemberI’m not sure what the issue is here. Maybe someone else on the forums could help you out.
muddu_shafiMemberCan you give a standard procedure to follow in order to connect to a database. Like how to import the jar files for databases, where to place these jar files, how to check/test whether the jar files are working good in connecting to a database.
Rahman
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)