DataBase Fixed
This commit is contained in:
parent
14686a930f
commit
bd4694e44b
|
|
@ -26,9 +26,9 @@ public class JDBCsetUp {
|
||||||
public static void executeUpdate(String sql) throws SQLException{
|
public static void executeUpdate(String sql) throws SQLException{
|
||||||
try (Connection connection = getConnection()) {
|
try (Connection connection = getConnection()) {
|
||||||
|
|
||||||
PreparedStatement useStatement = connection.prepareStatement("USE ?");
|
try (Statement useStatement = connection.createStatement()) {
|
||||||
useStatement.setString(1, JdbcConfig.DATABASE_NAME.get());
|
useStatement.execute("USE " + JdbcConfig.DATABASE_NAME.get());
|
||||||
useStatement.executeUpdate();
|
}
|
||||||
|
|
||||||
try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
|
try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
|
||||||
updateStatement.executeUpdate();
|
updateStatement.executeUpdate();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user