diff --git a/rocketmq/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java b/rocketmq/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java index 056d939..f3c5b67 100644 --- a/rocketmq/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java +++ b/rocketmq/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java @@ -119,12 +119,12 @@ private boolean computeTotalRecords() { } private boolean createDB() { - Statement statement = null; + PreparedStatement statement = null; try { - statement = this.connection.createStatement(); - String sql = this.createTableSql(); log.info("createDB SQL:\n {}", sql); + + statement = this.connection.prepareStatement(sql); statement.execute(sql); this.connection.commit(); return true;