Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am getting the following error after I login and try to run the program in jav

ID: 3760604 • Letter: I

Question

I am getting the following error after I login and try to run the program in java, access, ucannaccess and netbeans:

Code:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Raj
*/
import java.sql.*;
import javax.swing.*;
public class Connect {
     Connection con=null;

        public static Connection ConnectDB(){
             String dataSourceName="HMS_DB";
          String dbURL;
         dbURL = dataSourceName + "jdbc:ucanaccess://C:\Users\Serenity\Desktop\Access Test\Hospital Management System (MS Access)\HMS_DB.accdb";
        try{
          
            Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
            Connection con = DriverManager.getConnection(dbURL, "","");
            return con;
          
        }catch(ClassNotFoundException | SQLException e){
            JOptionPane.showMessageDialog(null, e);
            return null;
  
    }    
}
}


Link to the full program: https://www.dropbox.com/s/k0027ted05jsvgz/errorcode.zip?dl=0

Can someone please assist?

Explanation / Answer

The dropbox link does not exist.

But, this problem exists when your server does not have the driver jar file.

You should try putting the driver jar file in the server lib folder.