Bugfix for new SqLite version

This commit is contained in:
Ziver Koc 2024-09-26 00:30:28 +02:00
parent 1e813d65ca
commit 1de26a7240
2 changed files with 3 additions and 2 deletions

View file

@ -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) {

View file

@ -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{