Skip to content

Commit

Permalink
mysql: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlschuetter committed Apr 20, 2024
1 parent 7744358 commit eab8c72
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

Expand Down Expand Up @@ -58,7 +59,8 @@ public void testDriverManagerConnectionToMysqlSock() throws Exception {
.getPassword())) {
connected = true;

try (ResultSet rs = conn.prepareStatement("SHOW TABLES").executeQuery()) {
try (PreparedStatement pstmt = conn.prepareStatement("SHOW TABLES");
ResultSet rs = pstmt.executeQuery()) {
if (rs.next()) {
assertNotNull(rs.getString(1));
}
Expand All @@ -69,7 +71,7 @@ public void testDriverManagerConnectionToMysqlSock() throws Exception {
} else {
throw new TestAbortedWithImportantMessageException(MessageType.TEST_ABORTED_WITH_ISSUES,
"Could not connect to MySQL database for testing. Please correct the following definitions: "
+ creds.toString());
+ creds.toString(), e);
}
}
}
Expand Down

0 comments on commit eab8c72

Please sign in to comment.