MxDev -2 Junior Poster

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.