I am using sqlite for standard edition of java reason is that i did not want to use much space.
Any way so wen I try to update the info in there it says that the database has been locked, pls
give me some advice
6 replies to this topic
#1
Posted 05 February 2012 - 11:29 PM
|
|
|
#2
Posted 06 February 2012 - 06:48 AM
Without seeing any code, it's almost impossible to help you.
#3
Posted 06 February 2012 - 06:53 AM
getDBConn();
prep = conn.prepareStatement("insert into tblGroups values (?,?,?,?,?)");
for (Group grp : groups)
if (!exists(grp))
prep.setString(1, grp.getName());
prep.setString(2, grp.getDescription());
prep.setString(3, grp.getId() + "");
prep.addBatch();
prep.executeUpdate();
saveRecipients(grp.getRecipients());
}
}
} catch (SQLException ex) {
Logger.getLogger(DBService.class.getName()).log(Level.SEVERE, null, ex);
}
closeConnDB();
#4
Posted 06 February 2012 - 12:25 PM
Mozana, my guess is you still have an open connection before that section. As a result, the above runs into the file lock.
#5
Posted 09 February 2012 - 10:53 PM
the thing is even if I set the connection to null and reinitialise it the exception is thrown, guess Ill try a different db, Thank you man
#6
Posted 09 February 2012 - 11:18 PM
Setting it to null is not closing it. Connection.close() is closing it.
#7
Posted 10 February 2012 - 05:53 AM
lol yea, I also kept calling the
closeConnDB();which duz close the method, but yea I am now using sqljet
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









