I have problem with SQLite connection on my Java project. Error looks like this :
No suitable driver found for JDBC:sqlite:main.db
That's my code:
public static void main(String[] args) {
Connection c = null;
try {
// Class.forName("org.sqlite.JDBC");
String url = "JDBC:sqlite:main.db";
c = DriverManager.getConnection(url);
System.out.println("Connection to sql");
} catch ( SQLException e ) {
System.err.println( e.getMessage() );
} finally {
try{
if( c!= null ) {
c.close();
}
}catch( SQLException ex )
{
System.out.println(ex.getMessage());
}
}
}
Can You help me please?