I developed a web application whose database is MS Access, well, when the user logs in I send the data by ajax to the java class to do the login validation and password, the problem is that when the system will connect in the bank my connection class of the following error "java.sql.SQLException: No suitable driver found for jdbc: ucanaccess: // database_datas \ softTech.accdb" So, okay, I'm not finding a driver, but I decided to do a test and I created a "public static void main" method in my connection class, and I called the same login validation method, the class got as follows:
public static Connection conectar() {
Connection conexao = null;
try {
conexao = DriverManager.getConnection("jdbc:ucanaccess://banco_dados\softTech.accdb");
} catch (Exception e) {
System.out.println("Erro na conexão com o banco " + e.toString());
}
return conexao;
}
public static void main(String[] args) {
try {
Funcionario f = new Funcionario();
f.setLoginFuncionario("TESTE");
f.setSenhaFuncionario("TESTE");
String resultado = new FuncionarioDAO().validaLogin(f);
System.out.println(resultado);
} catch (Exception e) {
System.out.println(e.toString());
}
}
When executing this class, the thing is strange, because the connection is done normally, I do not know what I might be needing help.
The error it gives is this:
java.sql.SQLException: No suitable driver found for jdbc: ucanaccess: //src/banco_dados/softTech.accdb
But as I said the driver was inserted yes, and when I test it directly through the class it does not give any errors.