0

I'm encountering this error

java.sql.SQLException:[SQLITE BUSY] The database file  is locked (database is locked) 

every time I run my jar file that I built. It's fine when I'm running it from my netbeans though. I already tried closing the resultset and preparedstatement but it still shows up when I'm running the jar file. How can I get rid of this? Should I also close the connection?

PG20
  • 67
  • 1
  • 2
  • 10
  • http://stackoverflow.com/questions/39510409/sqlite-busy-the-database-is-locked-java ,see this one. – parlad May 21 '17 at 13:39
  • I tried closing the resultset and preparedstatement on the finally block and it still doesn't work – PG20 May 21 '17 at 13:43
  • Do you have multiple connections? , http://stackoverflow.com/questions/13891006/getting-sqlite-busy-database-file-is-locked-with-select-statements – parlad May 21 '17 at 13:46
  • My Login.java connects first then my Admin.java connects if the password and username is right on the Login.java. – PG20 May 21 '17 at 13:53
  • and connection you are doing in Login.java has been closed? – parlad May 21 '17 at 13:58
  • Yes it has been closed in Login.java. It still doesn't work. EDIT: It's working now for some reason (I just closed the jar file then opened it again). Thank you. – PG20 May 21 '17 at 14:00
  • well ,the good practice is Connection should to be closed after each query, there can be more than one process is trying to modify the database. – parlad May 21 '17 at 14:07

1 Answers1

0

Try closing Netbeans first. It's possible it's holding on to the write lock.

Sam
  • 670
  • 1
  • 6
  • 20