UCanAccess "user does not have sufficient privileges or object not found"

0

I have a problem using Ucanaccess. When I try to execute the query

String query="SELECT Last Name FROM Table1 WHERE Name LIKE" + name;

gives me the following exception:

net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc ::: 4.0.4 user does not have sufficient privileges or object not found

MAIN:

    String nombre = jTextField1.getText();
    Connection conexion;
    PreparedStatement query;
    ResultSet resultado;
    String consulta = "SELECT Apellido FROM Tabla1 WHERE NombreLIKE"+nombre;

    String directorio = "jdbc:ucanaccess://C:\Users\locur\Desktop\Backup\Java\Conecion Access\Recuperar\Database1.accdb";

    try {
        Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");//Selecciono los drives a utilizar
        conexion = DriverManager.getConnection(directorio);//Establesco conexion con la base

        jLabel5.setText("Conexion exitosa");

        query = conexion.prepareStatement(consulta);//Ejecuto consulta

        resultado = query.executeQuery();//Obtengo el resultado de la consulta

        while (resultado.next()) {
            String Apellido = resultado.getString("Apellido");
            jLabel4.setText(Apellido);
        }
        conexion.close();
    } catch (Exception e) {
        System.out.println(e);

    }
    
asked by Nicolas Martinez 12.08.2018 в 19:26
source

0 answers