Java 6's rhino / javascript database connectivity
843853Nov 24 2006 — edited Jul 14 2010Hi
I am trying to load the Sybase database driver within the javascript and doesn't seem to get it working... Here are my sample command/code:
command:
jrunscript -classpath "c:\javascript\jconn2.jar" testdb.js
source code of testdb.js:
1 importPackage(java.sql);
2 importPackage(java.lang);
3
4 Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
The error is:
C:\javascript>jrunscript -classpath "c:\javascript\jconn2.jar" testdb.js
script error in file testdb.js : sun.org.mozilla.javascript.internal.WrappedExce
ption: Wrapped java.lang.ClassNotFoundException: com/sybase/jdbc2/jdbc/SybDriver
(testdb.js#4) in testdb.js at line number 4
Anyone has an idea?
Thanks,
Edmond