I am getting this error when running a login screen. I'm really not sure what the issue is as I followed a tutorial, and for him it worked fine. Here is my code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Connection con = null;
PreparedStatement pst = null ;
ResultSet rs = null;
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con = DriverManager.getConnection("jdbc:ucanaccess://C:\\Users\\Morgan\\Documents\\Database1.accdb");
String sq1 = "select * from user_account where username = '"+ tfusr.getText() +"' and password = '"+ tfpwsd.getText() +"' ";
pst = con.prepareStatement(sq1);
rs = pst.executeQuery();
if(rs.next())
{
JOptionPane.showMessageDialog(null,"Login successfull");
}
else {
JOptionPane.showMessageDialog(null , "Login Failed");
}
}
catch(Exception e){
System.out.println(e);
}
Here are my dependencies: