| | |
Help in Sqlite database is locked Exception
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2007
Posts: 70
Reputation:
Solved Threads: 2
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.
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.
![]() |
Other Threads in the Java Forum
- Previous Thread: strange java behaviour?
- Next Thread: Hw help
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application array arrays automation binary bluetooth button character chat class classes client code component css csv database draw eclipse ee error event exception fractal game givemetehcodez graphics gui html ide image input integer j2me japplet java javaarraylist javaprojects jmf jni jpanel julia jvm key linked linux list loan loop map method methods mobile netbeans newbie objects oracle oriented output panel phone print printf problem program programming project projects recursion replaydirector reporting researchinmotion robot scanner screen se server service set size sms software sort sql string swing test threads time transfer tree ubuntu windows





