Skip to content

Commit

Permalink
update mysql-connector-java to 8.0.28
Browse files Browse the repository at this point in the history
- fix one ResultSet.first() function call which is now illegal for
        a forward only result set (the default type)
  • Loading branch information
sheridancbio committed Mar 19, 2024
1 parent e388941 commit 62fb552
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<maf.version>1.0.0</maf.version>


<mysql_driver.version>5.1.48</mysql_driver.version>
<mysql_driver.version>8.0.28</mysql_driver.version>
<mysql_commons_lang3.version>3.13.0</mysql_commons_lang3.version>

<commons_dbcp2.version>2.10.0</commons_dbcp2.version>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/mskcc/cbio/portal/dao/JdbcDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String getLabel() {
}
}

public JdbcDataSource () {
public JdbcDataSource() {
DatabaseProperties dbProperties = DatabaseProperties.getInstance();
logUsedDeprecatedProperties(dbProperties);
// extract required property values
Expand All @@ -65,6 +65,8 @@ public JdbcDataSource () {
this.setDriverClassName(mysqlDriverClassName);
// Disable this to avoid caching statements
this.setPoolPreparedStatements(Boolean.valueOf(enablePooling));
// this property setting is needed to enable MySQLbulkLoader to load data from a local file
this.addConnectionProperty("allowLoadLocalInfile", "true");
// these values are from the production cbioportal application context for a jndi data source
this.setMaxTotal(500);
this.setMaxIdle(30);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/mskcc/cbio/portal/dao/MySQLbulkLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ public static int flushAll() throws DaoException {
con = JdbcUtil.getDbConnection(MySQLbulkLoader.class);
stmt = con.prepareStatement("SELECT @@foreign_key_checks;");
ResultSet result = stmt.executeQuery();

result.first();
result.next();
checks = result.getInt(1);

stmt = con.prepareStatement("SET foreign_key_checks = ?;");
stmt.setLong(1, 0);
stmt.execute();
Expand Down

0 comments on commit 62fb552

Please sign in to comment.