Reputation: 6983
When I call The staement
c = DriverManager.getConnection("jdbc:sqlite:sample.db");
I get a exception saying
no Suitable Driver Found for jdbc:sqlite:sample.db
The project is running in eclipse on a windows platform.
This is what I did:
The code
try {
// exception goes off here
c = DriverManager.getConnection("jdbc:sqlite:sample.db");
} catch(Exception e){
ted=ted+1;
} //
Upvotes: 0
Views: 2117
Reputation: 30809
You need to load the driver class before trying to acquire the connection. Can you try the following:
Class.forName("org.sqlite.JDBC");
This will throw NoClassDefFoundError
if the driver jar
is not on the classpath.
Upvotes: 3