@SuppressWarnings({
    "squid:S3776",
    "squid:S6541"
  }) // ignore Cognitive Complexity of methods should not be too high
  // ignore Methods should not perform too many tasks (aka Brain method)
  @Override
  public void setObject(int parameterIndex, Object parameterObj, int targetSqlType, int scale)
      throws SQLException {
    if (parameterObj == null) {
      setNull(parameterIndex, java.sql.Types.OTHER);
    } else {
      try {
        switch (targetSqlType) {
          case Types.BOOLEAN:
            if (parameterObj instanceof Boolean) {
              setBoolean(parameterIndex, ((Boolean) parameterObj).booleanValue());
              break;
            } else if (parameterObj instanceof String) {
              if ("true".equalsIgnoreCase((String) parameterObj)
                  || "Y".equalsIgnoreCase((String) parameterObj)) {
                setBoolean(parameterIndex, true);
              } else if ("false".equalsIgnoreCase((String) parameterObj)
                  || "N".equalsIgnoreCase((String) parameterObj)) {
                setBoolean(parameterIndex, false);
              } else if (((String) parameterObj).matches("-?\\d+\\.?\\d*")) {
                setBoolean(parameterIndex, !((String) parameterObj).matches("-?[0]+[.]*[0]*"));
              } else {
                throw new SQLException(
                    "No conversion from " + parameterObj + " to Types.BOOLEAN possible.");
              }
              break;
            } else if (parameterObj instanceof Number) {
              int intValue = ((Number) parameterObj).intValue();

              setBoolean(parameterIndex, intValue != 0);

              break;
            } else {
              throw new SQLException(
                  "No conversion from " + parameterObj + " to Types.BOOLEAN possible.");
            }

          case Types.BIT:
          case Types.TINYINT:
          case Types.SMALLINT:
          case Types.INTEGER:
          case Types.BIGINT:
          case Types.REAL:
          case Types.FLOAT:
          case Types.DOUBLE:
          case Types.DECIMAL:
          case Types.NUMERIC:
            setNumericObject(parameterIndex, parameterObj, targetSqlType, scale);
            break;
          case Types.CHAR:
          case Types.VARCHAR:
          case Types.LONGVARCHAR:
            if (parameterObj instanceof BigDecimal) {
              setString(
                  parameterIndex,
                  StringUtils.fixDecimalExponent(
                      StringUtils.consistentToString((BigDecimal) parameterObj)));
            } else {
              setString(parameterIndex, parameterObj.toString());
            }

            break;

          case Types.CLOB:
            if (parameterObj instanceof java.sql.Clob) {
              setClob(parameterIndex, (java.sql.Clob) parameterObj);
            } else {
              setString(parameterIndex, parameterObj.toString());
            }

            break;

          case Types.BINARY:
          case Types.VARBINARY:
          case Types.LONGVARBINARY:
          case Types.BLOB:
            throw new SQLException(Constant.PARAMETER_SUPPORTED);
          case Types.DATE:
          case Types.TIMESTAMP:
            java.util.Date parameterAsDate;

            if (parameterObj instanceof String) {
              ParsePosition pp = new ParsePosition(0);
              DateFormat sdf =
                  new SimpleDateFormat(getDateTimePattern((String) parameterObj, false), Locale.US);
              parameterAsDate = sdf.parse((String) parameterObj, pp);
            } else {
              parameterAsDate = (Date) parameterObj;
            }

            switch (targetSqlType) {
              case Types.DATE:
                if (parameterAsDate instanceof java.sql.Date) {
                  setDate(parameterIndex, (java.sql.Date) parameterAsDate);
                } else {
                  setDate(parameterIndex, new java.sql.Date(parameterAsDate.getTime()));
                }

                break;

              case Types.TIMESTAMP:
                if (parameterAsDate instanceof java.sql.Timestamp) {
                  setTimestamp(parameterIndex, (java.sql.Timestamp) parameterAsDate);
                } else {
                  setTimestamp(parameterIndex, new java.sql.Timestamp(parameterAsDate.getTime()));
                }

                break;
              default:
                logger.error("No type was matched");
                break;
            }

            break;

          case Types.TIME:
            if (parameterObj instanceof String) {
              DateFormat sdf =
                  new SimpleDateFormat(getDateTimePattern((String) parameterObj, true), Locale.US);
              setTime(parameterIndex, new Time(sdf.parse((String) parameterObj).getTime()));
            } else if (parameterObj instanceof Timestamp) {
              Timestamp xT = (Timestamp) parameterObj;
              setTime(parameterIndex, new Time(xT.getTime()));
            } else {
              setTime(parameterIndex, (Time) parameterObj);
            }

            break;

          case Types.OTHER:
            throw new SQLException(Constant.PARAMETER_SUPPORTED); //
          default:
            throw new SQLException(Constant.PARAMETER_SUPPORTED); //
        }
      } catch (SQLException ex) {
        throw ex;
      } catch (Exception ex) {
        throw new SQLException(Constant.PARAMETER_SUPPORTED); //
      }
    }
  }
save the SQL parameters as (paramLoc,paramValue) pairs.
iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java