diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/SavedPreparedStatement.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/SavedPreparedStatement.java
index 5e4aacb8601a6a0cc3e82d3c2ac7640248c047ef..98c3fdd7fca9d0c92efbb8447e8938568e4bce6b 100644
--- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/SavedPreparedStatement.java
+++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/SavedPreparedStatement.java
@@ -33,9 +33,9 @@ public class SavedPreparedStatement {
/**
* insert or import sql template pattern, the template are the following:
- *
+ *
* insert/import into tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ] values(?, ?, ...) (?, ?, ...)
- *
+ *
* we split it to three part:
* 1. prefix, insert/import
* 2. middle, tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ]
@@ -70,9 +70,9 @@ public class SavedPreparedStatement {
/**
* default param value
*/
- private static final String DEFAULT_VALUE= "NULL";
+ private static final String DEFAULT_VALUE = "NULL";
- private static final String PLACEHOLDER= "?";
+ private static final String PLACEHOLDER = "?";
private String tableName;
@@ -81,7 +81,7 @@ public class SavedPreparedStatement {
*/
private boolean isAddBatch;
- public SavedPreparedStatement(String sql, TSDBPreparedStatement tsdbPreparedStatement)throws SQLException {
+ public SavedPreparedStatement(String sql, TSDBPreparedStatement tsdbPreparedStatement) throws SQLException {
this.sql = sql;
this.tsdbPreparedStatement = tsdbPreparedStatement;
this.sqlParamList = new ArrayList<>();
@@ -91,17 +91,18 @@ public class SavedPreparedStatement {
/**
* parse the init param according the sql param
+ *
* @param sql
*/
- private void parsePreparedParam(String sql)throws SQLException{
+ private void parsePreparedParam(String sql) throws SQLException {
Matcher matcher = sqlPattern.matcher(sql);
- if(matcher.find()){
+ if (matcher.find()) {
tableName = matcher.group("tablename");
- if (tableName != null && PLACEHOLDER.equals(tableName)){
+ if (tableName != null && PLACEHOLDER.equals(tableName)) {
// the table name is dynamic
this.isTableNameDynamic = true;
}
@@ -110,26 +111,26 @@ public class SavedPreparedStatement {
middle = matcher.group(2);
valueList = matcher.group("valueList");
- if(middle != null && !"".equals(middle)){
+ if (middle != null && !"".equals(middle)) {
middleParamSize = parsePlaceholder(middle);
}
- if(valueList != null && !"".equals(valueList)){
+ if (valueList != null && !"".equals(valueList)) {
valueListSize = parsePlaceholder(valueList);
}
initPreparedParam = initDefaultParam(tableName, middleParamSize, valueListSize);
- }else{
+ } else {
// not match
throw new SQLException(TSDBConstants.WrapErrMsg("the sql is not complete!"));
}
}
- private TSDBPreparedParam initDefaultParam(String tableName, int middleParamSize, int valueListSize){
+ private TSDBPreparedParam initDefaultParam(String tableName, int middleParamSize, int valueListSize) {
- TSDBPreparedParam tsdbPreparedParam = new TSDBPreparedParam(tableName);
+ TSDBPreparedParam tsdbPreparedParam = new TSDBPreparedParam(tableName);
tsdbPreparedParam.setMiddleParamList(getDefaultParamList(middleParamSize));
@@ -140,14 +141,15 @@ public class SavedPreparedStatement {
/**
* generate the default param value list
+ *
* @param paramSize
* @return
*/
- private List