At the moment I'm doing an insert in access through the connection with ucanaccess, the connection works but the query gets me some exceptions, with some users when I insert them and this is what I get in the console:
java.lang.IllegalStateException: Could not find child entry in parent; childEntry NodeEntry [rowId = 400691: 2, subPage = 398333, bytes = (14) 7F 80 00 0B E8 7F C0 E4 F4 47 A2 B3 C4 D6]; parent NodeDataPage [318587] 56830, 10326, (299665) [entries = [NodeEntry [rowId = 8497: 31, subPage = 57319, bytes = (14) 7F 80 00 0A 31 7F C0 E4 86 DA 9D 33 F5 61], NodeEntry [rowId = 228496: 40, subPage = 10286, bytes = (14) 7F 80 00 0A 31 7F C0 E4 90 67 F9 14 19
net.ucanaccess.jdbc.UcanaccessSQLException: Could not find child entry in parent;
Does anyone know anything about that error that comes to me?
This is the manager where I call the connection and send it to the DAO
public boolean RegistroSalida(String id)throws Exception{
connection = ConexionAccess.getConexion();
boolean respuesta = false;
try {
objDAO = new LectorDAO();
respuesta = objDAO.RegistroSalida(id,connection);
} catch (Exception e) {
e.printStackTrace();
System.out.println(e);
}
//connection.close();
return respuesta;
}
here is where I do the insert that I do in the DAO
public boolean RegistroSalida(String id, Connection conexion) throws Exception{
boolean respuesta = false;
try {
String query = "INSERT INTO checkinout (USERID,CHECKTIME,CHECKTYPE,VERIFYCODE,SENSORID,Memoinfo,WorkCode,sn,UserExtFmt) "
+ " SELECT USERINFO.USERID, now(), 'I', 3, '107', '', 0 , '' , 1 "
+ " FROM USERINFO" + " WHERE (((USERINFO.[SSN])='"+ id +"'));";
PreparedStatement ps = conexion.prepareStatement(query);
System.out.println(query);
if (ps.executeUpdate() >= 0)
respuesta = true;
System.out.println("oK");
} catch (Exception e) {
e.printStackTrace();
System.out.println(e);
System.out.println("Paila");
}
return respuesta;
}
This is the connection to the Access database:
public class ConexionAccess { private static Connection cn = null;
public static Connection getConexion() throws SQLException {
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
cn = DriverManager.getConnection("jdbc:ucanaccess://D:/attBackup01042015.mdb;memory=true");
} catch (Exception e) {
e.printStackTrace();
}
return cn;
}
}