Skip to content

Commit 64b24e8

Browse files
committed
Register JDBC Driver manually
1 parent 6994afc commit 64b24e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/github/cshubhamrao/AUtDv2/db/DatabaseTasks.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ public class DatabaseTasks {
4444

4545
private static final java.util.logging.Logger logger = Log.logger;
4646

47+
static {
48+
try {
49+
Class.forName("org.sqlite.JDBC");
50+
} catch (ClassNotFoundException ex) {
51+
logger.log(Level.SEVERE, "Unable to Initialize SQLite Driver", ex);
52+
}
53+
}
54+
4755
public static Classwork fetchCW(int cwNo) {
4856
String query = "SELECT * FROM " + Classwork.TABLE_NAME
4957
+ " WHERE cw_no = " + cwNo + " ORDER BY rowid DESC;";

0 commit comments

Comments
 (0)