Skip to content

Commit a3867a9

Browse files
Merge pull request #81 from brodyspark/update-delete-fix-1
Add SQLiteStatement.executeUpdateDelete() from Android API 11
2 parents 4830c36 + f1898ca commit a3867a9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/net/sqlcipher/database/SQLiteStatement.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,24 @@ public long executeInsert() {
9090
}
9191
}
9292

93+
public long executeUpdateDelete() {
94+
if (!mDatabase.isOpen()) {
95+
throw new IllegalStateException("database " + mDatabase.getPath() + " already closed");
96+
}
97+
long timeStart = SystemClock.uptimeMillis();
98+
mDatabase.lock();
99+
100+
acquireReference();
101+
try {
102+
native_execute();
103+
mDatabase.logTimeStat(mSql, timeStart);
104+
return mDatabase.lastChangeCount();
105+
} finally {
106+
releaseReference();
107+
mDatabase.unlock();
108+
}
109+
}
110+
93111
/**
94112
* Execute a statement that returns a 1 by 1 table with a numeric value.
95113
* For example, SELECT COUNT(*) FROM table;

0 commit comments

Comments
 (0)