Bugfix for new SqLite version
This commit is contained in:
parent
1e813d65ca
commit
1de26a7240
2 changed files with 3 additions and 2 deletions
|
|
@ -142,7 +142,7 @@ public class DBConnection implements Closeable{
|
|||
ResultSet result = null;
|
||||
try {
|
||||
result = stmt.getGeneratedKeys();
|
||||
if (result != null) {
|
||||
if (result != null && !result.isBeforeFirst()) {
|
||||
return new SimpleSQLResult<Integer>().handleQueryResult(stmt, result);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
|
|
|||
|
|
@ -37,10 +37,11 @@ import java.sql.Statement;
|
|||
*/
|
||||
public class SimpleSQLResult<T> implements SQLResultHandler<T> {
|
||||
/**
|
||||
* Is called to handle an result from an query.
|
||||
* Is called to return the first data generated by a query.
|
||||
*
|
||||
* @param stmt is the query
|
||||
* @param result is the ResultSet
|
||||
* @return first value of the given query or null if the query returned no result.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T handleQueryResult(Statement stmt, ResultSet result) throws SQLException{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue