0

I have searched through a couple of the questions, which have already been answered but most of them were for mysql. I have an issue with my program, as it does not connect to the database.

Connection conn = null;

public static Connection ConnectDb() {
    try {
        Class.forName("org.sqlite.JDBC");
        Connection conn = DriverManager.getConnection("jdbc.sqlite:C:\\Users\\Emerald\\Documents\\NetBeansProjects\\ITPAT\\DietTracker.sqlite");
        JOptionPane.showMessageDialog(null, "Connection Established");
        return conn;
    }
    catch(Exception e) {
        JOptionPane.showMessageDialog(null, e);
                return null;
    }
}
JNYRanger
  • 6,829
  • 12
  • 53
  • 81
K. Deen
  • 1
  • 1

0 Answers0