Class SqlBuilder.PreparedSqlBuilder.PreparedBatch

java.lang.Object
org.tamilnadujug.SqlBuilder.PreparedSqlBuilder.PreparedBatch
Enclosing class:
SqlBuilder.PreparedSqlBuilder

public final class SqlBuilder.PreparedSqlBuilder.PreparedBatch extends Object
JDBC Batch Builder.
  • Method Details

    • addBatch

      Adds JDBC Batch Builder.
      Returns:
      batch
      Throws:
      SQLException
    • executeBatch

      public int[] executeBatch(DataSource dataSource) throws SQLException
      executes the Batch.
      Parameters:
      dataSource -
      Returns:
      an array of update counts
      Throws:
      SQLException
    • paramNull

      Adds a parameter with a null.
      Returns:
      the current SqlBuilder instance, for method chaining
    • paramNull

      public SqlBuilder.PreparedSqlBuilder.PreparedBatch paramNull(int sqlType, String typeName)
      Adds a parameter with a specific SQL type and type name as `NULL` to the SQL query. This method is used when the SQL parameter should be set to `NULL`for types that require a type name in addition to the SQL type, such as SQL `STRUCT` or `ARRAY`.
      Parameters:
      sqlType - the SQL type of the parameter, as defined in Types
      typeName - the type name of the parameter, used for SQL types that require specific type information
      Returns:
      the current SqlBuilder instance, for method chaining
    • preparedParam

      public <T> SqlBuilder.PreparedSqlBuilder.PreparedBatch preparedParam(T value)
      Adds a parameter to the SQL query. The method allows chaining and is used to bind values to placeholders in the SQL query.
      Type Parameters:
      T -
      Parameters:
      value - the value of the parameter to be added
      Returns:
      the current SqlBuilder instance, for method chaining
    • param

      Adds a Short parameter to the SQL query.
      Parameters:
      value - the Short value to be added
      Returns:
      the current SqlBuilder instance, for method chaining
    • param

      Adds a parameter to the SQL query. The method allows chaining and is used to bind values to placeholders in the SQL query.
      Parameters:
      value - the value of the parameter to be added
      Returns:
      the current SqlBuilder instance, for method chaining
    • param

      Adds an Integer parameter to the SQL query.
      Parameters:
      value - the Integer value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Double parameter to the SQL query.
      Parameters:
      value - the Double value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Boolean parameter to the SQL query.
      Parameters:
      value - the Boolean value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Long parameter to the SQL query.
      Parameters:
      value - the Long value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Date parameter to the SQL query.
      Parameters:
      value - the Date value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Float parameter to the SQL query.
      Parameters:
      value - the Float value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      public SqlBuilder.PreparedSqlBuilder.PreparedBatch param(byte[] value)
      Adds a byte array parameter to the SQL query.
      Parameters:
      value - the byte array to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a BigDecimal parameter to the SQL query.
      Parameters:
      value - the BigDecimal value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Time parameter to the SQL query.
      Parameters:
      value - the Time value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds a Timestamp parameter to the SQL query.
      Parameters:
      value - the Timestamp value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      Adds an Object parameter to the SQL query.
      Parameters:
      value - the Object value to be added
      Returns:
      the current PreparedBatch instance for chaining
    • param

      public SqlBuilder.PreparedSqlBuilder.PreparedBatch param(Object value, int targetSqlType)
      Adds an Object parameter to the SQL query with targetSqlType.
      Parameters:
      value - the Object value to be added
      targetSqlType - the targeted SqlType.
      Returns:
      the current SqlBuilder instance, for method chaining