This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e7918cc5b5f fix: IoTDBPreparedStatement implement  addBatch function 
(#12095)
e7918cc5b5f is described below

commit e7918cc5b5f26643e210485dfc0b6ccfc17626ed
Author: CritasWang <[email protected]>
AuthorDate: Wed Feb 28 14:45:34 2024 +0800

    fix: IoTDBPreparedStatement implement  addBatch function (#12095)
    
    remove JDBC IoTDBConnection commit  "Does not support commit"
---
 .../jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java     | 4 +---
 .../src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java   | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java 
b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
index bec0678db82..39cd2f54012 100644
--- a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
+++ b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
@@ -167,9 +167,7 @@ public class IoTDBConnection implements Connection {
   }
 
   @Override
-  public void commit() throws SQLException {
-    throw new SQLException("Does not support commit");
-  }
+  public void commit() throws SQLException {}
 
   @Override
   public Array createArrayOf(String arg0, Object[] arg1) throws SQLException {
diff --git 
a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
 
b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
index 5016d621036..c93c1d55027 100644
--- 
a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
+++ 
b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
@@ -80,7 +80,7 @@ public class IoTDBPreparedStatement extends IoTDBStatement 
implements PreparedSt
 
   @Override
   public void addBatch() throws SQLException {
-    throw new SQLException(METHOD_NOT_SUPPORTED_STRING);
+    super.addBatch(createCompleteSql(sql, parameters));
   }
 
   @Override
@@ -105,7 +105,7 @@ public class IoTDBPreparedStatement extends IoTDBStatement 
implements PreparedSt
 
   @Override
   public ResultSetMetaData getMetaData() throws SQLException {
-    throw new SQLException(METHOD_NOT_SUPPORTED_STRING);
+    return getResultSet().getMetaData();
   }
 
   @Override

Reply via email to