无法退出这个非法语句异常循环
Unable to exit this illegal statement exception loop
我是 android.And 的新手 我在 work.you 得到了这个任务 可以在日志中看到我得到了多个非法语句 times.what 我想要的是它应该只给这个异常一个time.below 是我认为导致异常的方法。
@Override
public boolean executeInsertQuery(String query) {
boolean isInsertSuccess;
SQLiteStatement sqlStmt = null;
try {
if (dbWriteInstance == null) {
dbWriteInstance = getWriteableDatabase();
}
sqlStmt = dbWriteInstance.compileStatement(query);
sqlStmt.executeInsert();
dbWriteInstance.yieldIfContendedSafely();
isInsertSuccess = true;
} catch (Exception e) {
bllLog.logInfo(LogWarningEvent.UNEXPECTED_EXCEPTION, e,
"Exception in SQLiteAccess.executeInsertQuery()");
isInsertSuccess = false;
} finally {
if (sqlStmt != null) {
sqlStmt.close();
}
}
return isInsertSuccess;
}
/**
* Compiles an SQL statement into a reusable pre-compiled statement object.
* The parameters are identical to {@link #execSQL(String)}. You may put ?s in the
* statement and fill in those values with {@link SQLiteProgram#bindString}
* and {@link SQLiteProgram#bindLong} each time you want to run the
* statement. Statements may not return result sets larger than 1x1.
*
* @param sql The raw SQL statement, may contain ? for unknown values to be
* bound later.
*
* @return A pre-compiled {@link SQLiteStatement} object. Note that
* {@link SQLiteStatement}s are not synchronized, see the documentation for more details.
*
* @throws SQLException If the SQL string is invalid for some reason
* @throws IllegalStateException if the database is not open
*/
public SQLiteStatement compileStatement(String sql) throws SQLException {
lock();
try {
if (!isOpen()) {
throw new IllegalStateException("database not open");
}
return new SQLiteStatement(this, sql);
} finally {
unlock();
}
}
查看从 10689 到 10715 的图像我得到了很多次我只想要整个块一次
关于此的任何建议都会有所帮助,谢谢..
是的@Bentaye 这个 class 的名称也是 sqlitedbaccess.sry 堆栈溢出不允许我发表更多评论。
我是 android.And 的新手 我在 work.you 得到了这个任务 可以在日志中看到我得到了多个非法语句 times.what 我想要的是它应该只给这个异常一个time.below 是我认为导致异常的方法。
@Override
public boolean executeInsertQuery(String query) {
boolean isInsertSuccess;
SQLiteStatement sqlStmt = null;
try {
if (dbWriteInstance == null) {
dbWriteInstance = getWriteableDatabase();
}
sqlStmt = dbWriteInstance.compileStatement(query);
sqlStmt.executeInsert();
dbWriteInstance.yieldIfContendedSafely();
isInsertSuccess = true;
} catch (Exception e) {
bllLog.logInfo(LogWarningEvent.UNEXPECTED_EXCEPTION, e,
"Exception in SQLiteAccess.executeInsertQuery()");
isInsertSuccess = false;
} finally {
if (sqlStmt != null) {
sqlStmt.close();
}
}
return isInsertSuccess;
}
/**
* Compiles an SQL statement into a reusable pre-compiled statement object.
* The parameters are identical to {@link #execSQL(String)}. You may put ?s in the
* statement and fill in those values with {@link SQLiteProgram#bindString}
* and {@link SQLiteProgram#bindLong} each time you want to run the
* statement. Statements may not return result sets larger than 1x1.
*
* @param sql The raw SQL statement, may contain ? for unknown values to be
* bound later.
*
* @return A pre-compiled {@link SQLiteStatement} object. Note that
* {@link SQLiteStatement}s are not synchronized, see the documentation for more details.
*
* @throws SQLException If the SQL string is invalid for some reason
* @throws IllegalStateException if the database is not open
*/
public SQLiteStatement compileStatement(String sql) throws SQLException {
lock();
try {
if (!isOpen()) {
throw new IllegalStateException("database not open");
}
return new SQLiteStatement(this, sql);
} finally {
unlock();
}
}
查看从 10689 到 10715 的图像我得到了很多次我只想要整个块一次
关于此的任何建议都会有所帮助,谢谢..
是的@Bentaye 这个 class 的名称也是 sqlitedbaccess.sry 堆栈溢出不允许我发表更多评论。