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

StackExchange.Redis how to query all keys only on one db

c# redis stackexchange.redis nosql

I am newbie in redis, Now i want get all keys in one db without knowing about keys or pattern of keys. After googling,I found a sodu code about my issue, but i have no key pattern or data field in ...

Retrieve without iterating from a SingletonMap

java map java-6

I have created a method that return me a Map which is singleton Map as below