Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit e33cc38

Browse files
committed
Add comments explaining the use of Class.forName("org.sqlite.JDBC");
1 parent 23b5f75 commit e33cc38

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

analyzer/src/main/java/com/novoda/sqlite/FileConnector.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public FileConnector(File dbFile) {
1616
@Override
1717
public Connection connect() throws SQLException {
1818
try {
19+
// Dynamically load the class in order to correctly initialise JDBC drivers, as described in
20+
// http://stackoverflow.com/questions/6740601/what-does-class-fornameorg-sqlite-jdbc-do/6740632#6740632
1921
Class.forName("org.sqlite.JDBC");
2022
} catch (ClassNotFoundException e) {
2123
e.printStackTrace();

analyzer/src/main/java/com/novoda/sqlite/MigrationsConnector.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public MigrationsConnector(Migrations migrations) {
2121
@Override
2222
public Connection connect() throws SQLException {
2323
try {
24+
// Dynamically load the class in order to correctly initialise JDBC drivers, as described in
25+
// http://stackoverflow.com/questions/6740601/what-does-class-fornameorg-sqlite-jdbc-do/6740632#6740632
2426
Class.forName("org.sqlite.JDBC");
2527
} catch (ClassNotFoundException e) {
2628
e.printStackTrace();

0 commit comments

Comments
 (0)