Interface DatabaseStatement

All Known Implementing Classes:
SimpleDatabaseStatement

public interface DatabaseStatement
  • Method Details

    • replace

      DatabaseStatement replace(String placeholder, String value)
      Replaces a placeholder in the SQL statement with a specific value.
      Parameters:
      placeholder - the placeholder to replace
      value - the value to replace with
      Returns:
      the updated SimpleDatabaseStatement object
    • addOption

      DatabaseStatement addOption(StatementOption option)
      Adds an option to the statement.
      Parameters:
      option - the statement option to add
      Returns:
      the updated SimpleDatabaseStatement object
    • clearOptions

      void clearOptions()
      Removes all options for this statement.
    • addBatch

      DatabaseStatement addBatch()
      Adds a batch operation to the statement.
      Returns:
      the updated SimpleDatabaseStatement object
    • withNullParameter

      DatabaseStatement withNullParameter()
      Sets a parameter in the statement as NULL.
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(Object object)
      Sets a parameter in the statement with a specified object.
      Parameters:
      object - the object to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(Object object, int sqlType)
      Sets a parameter in the statement with a specified object and SQL type.
      Parameters:
      object - the object to set as the parameter
      sqlType - the SQL type of the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(boolean value)
      Sets a parameter in the statement as a boolean value.
      Parameters:
      value - the boolean value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(String value)
      Sets a parameter in the statement as a string value.
      Parameters:
      value - the string value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(int value)
      Sets a parameter in the statement as an integer value.
      Parameters:
      value - the integer value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(long value)
      Sets a parameter in the statement as a long value.
      Parameters:
      value - the long value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(short value)
      Sets a parameter in the statement as a short value.
      Parameters:
      value - the short value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(byte value)
      Sets a parameter in the statement as a byte value.
      Parameters:
      value - the byte value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(float value)
      Sets a parameter in the statement as a float value.
      Parameters:
      value - the float value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(double value)
      Sets a parameter in the statement as a double value.
      Parameters:
      value - the double value to set as the parameter
      Returns:
      the updated SimpleDatabaseStatement object
    • withParameter

      DatabaseStatement withParameter(InputStream inputStream)
    • execute

      boolean execute()
      Executes the SQL statement.
      Returns:
      true if the execution was successful, false otherwise
    • executeUpdate

      int executeUpdate()
      Executes an update SQL statement.
      Returns:
      the number of rows affected
    • executeLargeUpdate

      long executeLargeUpdate()
      Executes a large update SQL statement.
      Returns:
      the number of rows affected
    • executeQuery

      void executeQuery(QueryReader reader)
      Executes a query SQL statement and processes the results with a QueryReader.
      Parameters:
      reader - the QueryReader to process the query results
    • fetchRow

      void fetchRow(QueryReader reader)
      Fetches the first row from the result set.
      Parameters:
      reader - the QueryReader to process the first row
    • fetchAllRows

      void fetchAllRows(QueryReader reader)
      Fetches all rows from the result set.
      Parameters:
      reader - the QueryReader to process all rows
    • executeBatch

      int[] executeBatch()
      Executes a batch of SQL statements.
      Returns:
      an array of update counts indicating the success of each command
    • executeLargeBatch

      long[] executeLargeBatch()
      Executes a large batch of SQL statements.
      Returns:
      an array of update counts indicating the success of each command