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;
|
ResultSet result = null;
|
||||||
try {
|
try {
|
||||||
result = stmt.getGeneratedKeys();
|
result = stmt.getGeneratedKeys();
|
||||||
if (result != null) {
|
if (result != null && !result.isBeforeFirst()) {
|
||||||
return new SimpleSQLResult<Integer>().handleQueryResult(stmt, result);
|
return new SimpleSQLResult<Integer>().handleQueryResult(stmt, result);
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,11 @@ import java.sql.Statement;
|
||||||
*/
|
*/
|
||||||
public class SimpleSQLResult<T> implements SQLResultHandler<T> {
|
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 stmt is the query
|
||||||
* @param result is the ResultSet
|
* @param result is the ResultSet
|
||||||
|
* @return first value of the given query or null if the query returned no result.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public T handleQueryResult(Statement stmt, ResultSet result) throws SQLException{
|
public T handleQueryResult(Statement stmt, ResultSet result) throws SQLException{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue