Class CmsDbUtil

java.lang.Object
org.opencms.db.CmsDbUtil

public final class CmsDbUtil extends Object
Generic database utility functions.

Since:
8.0.0
  • Method Details

    • fillParameters

      public static void fillParameters(PreparedStatement stmt, List<Object> params) throws SQLException
      Fills a given prepared statement with parameters from a list of objects.

      Parameters:
      stmt - the prepared statement
      params - the parameter objects
      Throws:
      SQLException - if something goes wrong
    • columnEquals

      public static CmsSimpleQueryFragment columnEquals(String column, Object o)
      Creates an expression for comparing a column with a constant.

      Parameters:
      column - the column name
      o - the constant
      Returns:
      the query expression
    • columnLike

      public static CmsSimpleQueryFragment columnLike(String column, String str)
      Creates an expression for matching a column with a constant pattern.

      Parameters:
      column - the column name
      str - the pattern string
      Returns:
      the query expression