My connection code:
try {
Connection con = DriverManager.getConnection("jdbc:sqlite:myDB.sqlite");
PreparedStatement pstm = con.prepareStatement("insert into hell(username,pssword) " +
"values ('"+tfUname.getText()+"','"+tfUpass.getText()+"')");
pstm.close();
con.close();
JOptionPane.showMessageDialog(null,"Congrats, you have been registered succesfully");
RegisterWindow rw = new RegisterWindow();
rw.setVisible(false);
pack();
dispose();
} catch(SQLException ex) {
setTitle(ex.toString());
}
This is just a window to insert a user name and password into the database. When I click the button following exception appears:
"java.sql.SQLException: No suitable driver found for jdbc:sqlite:C\\LoginJava2\\myDB.sqlite"
I found an example of how to connect to an SQLite database in Java which works well. I'm doing this in WindowBuilder (Eclipse), using the same driver from the example. I've tried different drivers but that message still appears.