8000 Add SQLiteStatement.executeUpdateDelete() from Android API 11 · Sjith/android-database-sqlcipher@f1898ca · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f1898ca

Browse files
author
Chris Brody
committed
Add SQLiteStatement.executeUpdateDelete() from Android API 11
1 parent 9d7e736 commit f1898ca

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)
0