Hi,

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.

My code looks like this:

import SQLite.JDBCDriver;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;



public class JDBCTest {

        /**
         * @param args
         */
        public static void main(String[] args) {
                // TODO Auto-generated method stub
                try {
                        Class.forName("SQLite.JDBCDriver");
                        
                        String url="jdbc:sqlite://home/pasquale/test.db";
                        Connection db = DriverManager.getConnection(url);
                        Statement st = db.createStatement();
                        
                        //Execute query
                        ResultSet rs = st.executeQuery("SELECT * "+"FROM tbl1");
                        
                        System.out.println("Output:");
                        
                        while (rs.next()){
                                System.out.println(rs.getString(0)+ " " + 
rs.getString(1));
                        }
                } catch (ClassNotFoundException e){
                        System.err.println("Error: "+e);
                } catch (SQLException e){
                        System.err.println("Error: "+e );
                }
        }
}

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). 
But I don't have clear what to do.

Could someone please help?
tia
Pasquale

Reply via email to