Help in Sqlite database is locked Exception

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2007
Posts: 70
Reputation: MxDev has a little shameless behaviour in the past 
Solved Threads: 2
MxDev MxDev is offline Offline
Junior Poster in Training

Help in Sqlite database is locked Exception

 
0
  #1
Dec 16th, 2008
hi guys,
iam workin on an application that calculate the income for certain diving centers, i using the SQLite database, i developed a database with 3 table the first one for user input, the second is to hold daily income, and the third for weekly income.

i've a problem when i'm trying to write in the second table the income after each user input, here's the exception when i'm using the Statement object

stmnt.execute("UPDATE dailyIncome SET Credit_NIS = '"+nis+"'");

java.sql.SQLException: database locked
at org.sqlite.DB.execute(DB.java:270)
at org.sqlite.Stmt.exec(Stmt.java:56)
at org.sqlite.Stmt.execute(Stmt.java:83)


and the following one is when i'm using the prepared statement

PreparedStatement pre = con.prepareStatement("UPDATE dailyIncome SET Credit_NIS = ? WHERE Date_PK = ?");

java.sql.SQLException: cannot commit transaction - SQL statements in progress
at org.sqlite.DB.throwex(DB.java:288)
at org.sqlite.DB.ensureAutoCommit(DB.java:336)
at org.sqlite.DB.execute(DB.java:264)
at org.sqlite.DB.executeUpdate(DB.java:281)
at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:77)



i need to know why this problem occured and how to solve it???

Thanks in advance.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC