Skip to content

Commit

Permalink
Fix database migrator
Browse files Browse the repository at this point in the history
Use next() instead of first() on TYPE_FORWARD_ONLY set
  • Loading branch information
Krakenied committed Nov 16, 2024
1 parent 082d6c2 commit 86f3687
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public int getInitialSchemaVersion() throws SQLException {
try (final Statement stmt = this.conn.createStatement();
final ResultSet rs = stmt.executeQuery(this.prefixer.apply(GET_STARTED_DATE_COLUMN))) {

if (rs.first()) {
if (rs.next()) {
return LATEST_SCHEMA_VERSION;
} else {
return 1;
Expand All @@ -548,7 +548,7 @@ public int getCurrentSchemaVersion() throws SQLException {
try (final Statement stmt = this.conn.createStatement();
final ResultSet rs = stmt.executeQuery(this.prefixer.apply(SELECT_SCHEMA_VERSION))) {

if (rs.first()) {
if (rs.next()) {
final int version = Integer.parseUnsignedInt(rs.getString(1));
this.plugin.getQuestsLogger().debug("Current schema version: " + version + ".");
return version;
Expand Down

0 comments on commit 86f3687

Please sign in to comment.