You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A very common sqlite example database exists: chinook.db. It can be downloaded here.
Earlier versions of sqlite-jdbc allowed connecting to this database, e.g., sqlite-jdbc-3.36.0.3.jar works. Newer versions such as sqlite-jdbc-3.43.2.2.jar or sqlite-jdbc-3.45.2.0.jar result in an SQLException "No suitable driver found for jdbc:sqlite:chinook.db"
To Reproduce
Create IntelliJ Project, put chinook.db inside the project folder. Download sqlite-jdbc-3.45.2.0.jar, add it to the project's classpath. Build and execute the following code:
` public static void main(String[] args) {
Connection conn = null;
try {
String url = "jdbc:sqlite:chinook.db";
conn = DriverManager.getConnection(url); // This line fails
System.out.println("Connection to SQLite has been established.");
} catch (SQLException e) {
System.out.println(e.getMessage());
} finally {
try {
if (conn != null) {
conn.close();
}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
}
}`
Expected behavior
Database connection should be opened, instead "No suitable driver found for jdbc:sqlite:chinook.db". When switching inside this project to an older lib version, connection is successful.
Environment (please complete the following information):
OS: Windows 10
Java SDK 22
IntelliJ
Additional context
May be a chinook.db problem?
The text was updated successfully, but these errors were encountered:
"No suitable driver found for" sounds more like a problem with the class path / module path / project setup. This is a default error message from within the DriverManager class. The DriverManager uses a simple ServiceLoader based mechanism to lookup all viable JDBC drivers and checks if one of the found drivers can handle the provided URL. If the error message get's thrown, no driver has been found on the class path, that can handle URLs of a certain pattern.
In a very basic Maven project consisting of the parts below, I cannot reproduce the issue. Tested with the versions you have mentioned and the latest release 3.46.0.0.
Describe the bug
A very common sqlite example database exists: chinook.db. It can be downloaded here.
Earlier versions of sqlite-jdbc allowed connecting to this database, e.g., sqlite-jdbc-3.36.0.3.jar works. Newer versions such as sqlite-jdbc-3.43.2.2.jar or sqlite-jdbc-3.45.2.0.jar result in an SQLException "No suitable driver found for jdbc:sqlite:chinook.db"
To Reproduce
Create IntelliJ Project, put chinook.db inside the project folder. Download sqlite-jdbc-3.45.2.0.jar, add it to the project's classpath. Build and execute the following code:
` public static void main(String[] args) {
Connection conn = null;
try {
String url = "jdbc:sqlite:chinook.db";
conn = DriverManager.getConnection(url); // This line fails
Expected behavior
Database connection should be opened, instead "No suitable driver found for jdbc:sqlite:chinook.db". When switching inside this project to an older lib version, connection is successful.
Environment (please complete the following information):
Additional context
May be a chinook.db problem?
The text was updated successfully, but these errors were encountered: