I have been trying to connect my java login form with access database without odbc. using ucanaccess driver.
After implementing all the instructions, all I am getting is the class.forName exception first plus many other exceptions.
private void btnLoginMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
try{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
String path="C:\\Users\\yamao\\Downloads\\javaJars\\ExercicesAppDb.mdb";
String url="jdbc:ucanaccess://"+path;
Connection con = DriverManager.getConnection(url);
Statement st = con.createStatement();
ResultSet rst=st.executeQuery("select * from Users");
while(rst.next()){
if(rst.getString("passWord").equals(passWordTxt.getText())){
JOptionPane.showMessageDialog(this,"Successful Connection");
}
}
}catch(SQLException ex1){System.out.print(ex1);}
catch(Exception ex2){}
}
I am expecting to have a login in light with data in my database