@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)
  private void setNumericObject(
      int parameterIndex, Object parameterObj, int targetSqlType, int scale) throws SQLException {
    Number parameterAsNum;

    if (parameterObj instanceof Boolean) {
      parameterAsNum =
          ((Boolean) parameterObj).booleanValue() ? Integer.valueOf(1) : Integer.valueOf(0);
    } else if (parameterObj instanceof String) {
      switch (targetSqlType) {
        case Types.BIT:
          if ("1".equals(parameterObj) || "0".equals(parameterObj)) {
            parameterAsNum = Integer.valueOf((String) parameterObj);
          } else {
            boolean parameterAsBoolean = "true".equalsIgnoreCase((String) parameterObj);

            parameterAsNum = parameterAsBoolean ? Integer.valueOf(1) : Integer.valueOf(0);
          }

          break;

        case Types.TINYINT:
        case Types.SMALLINT:
        case Types.INTEGER:
          parameterAsNum = Integer.valueOf((String) parameterObj);

          break;

        case Types.BIGINT:
          parameterAsNum = Long.valueOf((String) parameterObj);

          break;

        case Types.REAL:
          parameterAsNum = Float.valueOf((String) parameterObj);

          break;

        case Types.FLOAT:
        case Types.DOUBLE:
          parameterAsNum = Double.valueOf((String) parameterObj);

          break;

        case Types.DECIMAL:
        case Types.NUMERIC:
        default:
          parameterAsNum = new java.math.BigDecimal((String) parameterObj);
      }
    } else {
      parameterAsNum = (Number) parameterObj;
    }

    switch (targetSqlType) {
      case Types.BIT:
      case Types.TINYINT:
      case Types.SMALLINT:
      case Types.INTEGER:
        setInt(parameterIndex, parameterAsNum.intValue());
        break;

      case Types.BIGINT:
        setLong(parameterIndex, parameterAsNum.longValue());
        break;

      case Types.REAL:
        setFloat(parameterIndex, parameterAsNum.floatValue());
        break;

      case Types.FLOAT:
        setFloat(parameterIndex, parameterAsNum.floatValue());
        break;
      case Types.DOUBLE:
        setDouble(parameterIndex, parameterAsNum.doubleValue());

        break;

      case Types.DECIMAL:
      case Types.NUMERIC:
        if (parameterAsNum instanceof java.math.BigDecimal) {
          BigDecimal scaledBigDecimal = null;

          try {
            scaledBigDecimal = ((java.math.BigDecimal) parameterAsNum).setScale(scale);
          } catch (ArithmeticException ex) {
            try {
              scaledBigDecimal =
                  ((java.math.BigDecimal) parameterAsNum).setScale(scale, BigDecimal.ROUND_HALF_UP);
            } catch (ArithmeticException arEx) {
              throw new SQLException(
                  "Can't set scale of '"
                      + scale
                      + "' for DECIMAL argument '"
                      + parameterAsNum
                      + "'");
            }
          }

          setBigDecimal(parameterIndex, scaledBigDecimal);
        } else if (parameterAsNum instanceof java.math.BigInteger) {
          setBigDecimal(
              parameterIndex,
              new java.math.BigDecimal((java.math.BigInteger) parameterAsNum, scale));
        } else {
          setBigDecimal(parameterIndex, BigDecimal.valueOf(parameterAsNum.doubleValue()));
        }

        break;
      default:
    }
  }
save the SQL parameters as (paramLoc,paramValue) pairs.
iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java