Skip to content

Commit

Permalink
DataBase Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mlus-asuka committed Aug 4, 2024
1 parent 14686a9 commit bd4694e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/vip/fubuki/playersync/util/JDBCsetUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public static QueryResult executeQuery(String sql) throws SQLException{
public static void executeUpdate(String sql) throws SQLException{
try (Connection connection = getConnection()) {

PreparedStatement useStatement = connection.prepareStatement("USE ?");
useStatement.setString(1, JdbcConfig.DATABASE_NAME.get());
useStatement.executeUpdate();
try (Statement useStatement = connection.createStatement()) {
useStatement.execute("USE " + JdbcConfig.DATABASE_NAME.get());
}

try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
updateStatement.executeUpdate();
Expand Down

0 comments on commit bd4694e

Please sign in to comment.