[sqlite-dev] java.lang.ClassNotFoundException: org.sqlite.JDBC

1,543 views
Skip to first unread message

Mike Henry

unread,
Jun 15, 2017, 6:53:08 PM6/15/17
to sqlit...@mailinglists.sqlite.org
how can I correct this error?

        Connection c = null;

        try {
            Class.forName("org.sqlite.JDBC");
            c = DriverManager.getConnection("jdbc:sqlite:mhdb.db");
        } catch ( Exception e ) {
            System.err.println( e.getClass().getName() + ": " + e.getMessage() );
            System.exit(0);
        }
        System.out.println("Opened database successfully");

thanks

John McKown

unread,
Jun 16, 2017, 10:27:09 AM6/16/17
to sqlit...@mailinglists.sqlite.org

I think that this would better be in sqlite-users, but I could be
wrong about that.
In any case, perhaps this will help?
http://www.sqlitetutorial.net/sqlite-java/sqlite-jdbc-driver/
But, in short, you need the appropriate SQLite jar file in your Java
CLASS_PATH environment variable, of referenced in the "-cp" option on
the "java" command. If you use Netbeans for your Java development, use
the method in the tutorial.


--
Veni, Vidi, VISA: I came, I saw, I did a little shopping.

Maranatha! <><
John McKown
_______________________________________________
sqlite-dev mailing list
sqlit...@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev

Mike Henry

unread,
Jun 16, 2017, 12:41:11 PM6/16/17
to sqlit...@mailinglists.sqlite.org
John
Thanks, however, I am NOT using NetBeans
I am using Android Studio on Windows 10
Can you tell me what I need to do for this development environment?

Thanks



Mike Henry

unread,
Jun 16, 2017, 12:51:17 PM6/16/17
to sqlit...@mailinglists.sqlite.org











John

Thanks, however, I am NOT using NetBeans

I am using Android Studio on Windows 10

Can you tell me what I need to do for this development environment?




Thanks




Mike Henry

unread,
Jun 16, 2017, 1:15:53 PM6/16/17
to sqlit...@mailinglists.sqlite.org
java.sql.SQLException: opening db: "./MHDB.db" open failed. EROFS (Read-only file system)



John McKown

unread,
Jun 16, 2017, 1:48:04 PM6/16/17
to sqlit...@mailinglists.sqlite.org
On Fri, Jun 16, 2017 at 11:37 AM, Mike Henry <mhenr...@yahoo.com> wrote:
> John
> Thanks, however, I am NOT using NetBeans
> I am using Android Studio on Windows 10
> Can you tell me what I need to do for this development environment?

Sorry, no. I don't do Android work. Nor do I do programming on a
Windows platform. I'm a GNU/Linux bigot.

>
> Thanks

Mike Henry

unread,
Jun 16, 2017, 4:49:44 PM6/16/17
to sqlit...@mailinglists.sqlite.org
do you know anybody over there who does ?

thanks



Reply all
Reply to author
Forward
0 new messages