--- Pasquale Imbemba <[EMAIL PROTECTED]> wrote: > I am using the sqlite wrapper by Christian Werner for Java on my Linux > machine. I use eclipse and I have create da new project which contains > the SQLite.jar stuff. > > Whenever I try to compile, I get the following error: > java.lang.ClassNotFoundException: SQLite.JDBC2y.JDBCConnection > Error: java.sql.SQLException: No suitable driver > > I found this link from Sun's Java Technology site > (http://forum.java.sun.com/thread.jspa?threadID=602869&messageID=3248193), > where it says I can't use this wrapper "as is" for 1.5. (I am using JDK > 5.0.6).
The solution is given in the link you provided: "This driver was compiled with JRE 1.4.2 and is working with this version. If you use 1.5.* you must recompile it with this Java version." So you must either: (a) run your existing code with JRE 1.4.2, or (b) recompile (./configure && make) the SQLite driver from source code using JDK 1.5.0 to use it with JRE 1.5.0. The SQLite.JDBCDriver checks the java version at runtime and loads different classes. If you want the same driver sqlite.jar file to run under JRE 1.4, JRE 1.5 or higher, I think the following untested patch (./configure && make using JDK 1.4.2) should work: --- javasqlite-20050608/SQLite/JDBCDriver.java-orig 2006-05-11 20:58:10.000000000 -0400 +++ javasqlite-20050608/SQLite/JDBCDriver.java 2006-05-11 20:58:56.000000000 -0400 @@ -26,10 +26,8 @@ cvers = "SQLite.JDBC1.JDBCConnection"; } else if (jvers.startsWith("1.2") || jvers.startsWith("1.3")) { cvers = "SQLite.JDBC2.JDBCConnection"; - } else if (jvers.startsWith("1.4")) { - cvers = "SQLite.JDBC2x.JDBCConnection"; } else { - cvers = "SQLite.JDBC2y.JDBCConnection"; + cvers = "SQLite.JDBC2x.JDBCConnection"; } connClass = Class.forName(cvers); makeConn = connClass.getConstructor(args); __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com