Java Project Error after changing database from MySQL to SQLite

i am learning java i have created simple (CRUD) java program utilizing mysql,its works fine

and i want to try switching to SQLite with the same database(i already converted mysql database to sqlite)

i am using this JDBC driver:

But somehow,netbeans cannot complete running my program(despite there are no errors before) i got many new errors on output bar:

java.lang.ClassNotFoundException: org.sqlite.JDBCException in thread "AWT-EventQueue-0" java.lang.NullPointerException
at tes.MainForm.Tampil(
at tes.MainForm.<init>(
at tes.MainForm$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$200(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

My DBConnection class

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class DBConnection {   
Connection c = null;
Statement script;

public DBConnection(){
 //  Class.forName("com.mysql.jdbc.Driver");
   // c = DriverManager.getConnection("jdbc:ucanaccess://c:/asa.accdb");
 c = DriverManager.getConnection("jdbc:sqlite:C:/titit2.db");
   // c = DriverManager.getConnection("jdbc:mysql://localhost:3306/titit","root","root");
    script = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    System.out.println("Koneksi Sukses");
    }catch(  SQLException | ClassNotFoundException ex){

Inside my mainform class (line 23-46)

    private void Tampil(){
        int row = tabel.getRowCount();
        for(int i=0;i<row;i++){
            tabeldata.delete(0, row);
        String sql;
        sql = "SELECT * from asu";
            ResultSet rs = c.script.executeQuery(sql);

            DataPegawai d = new DataPegawai();
    }catch(SQLException e){


ClassNotFoundException is an exception you can get during runtime. See: where it says the possible cause:

Thrown when an application tries to load in a class through its string name using:

  • The forName method in class Class.
  • The findSystemClass method in class ClassLoader .
  • The loadClass method in class ClassLoader.

So the problem is from my point of view, that you did not add it in netbeans to classpath correctly.

Moreover you should check you used the stable released version of driver. I'd suggest to use: sqlite-jdbc-3.7.2.jar

Need Your Help

Anyone able to help me with this bug in a login form?

php sql database passwords

So, I have a login form which is having a bit of trouble. It keepsechoing Incorrect password, please try again. whenever I try and access the restricted page. I have had a fiddle on myself, but I h...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.