Package org.opencms.db
Class CmsDbUtil
java.lang.Object
org.opencms.db.CmsDbUtil
Generic database utility functions.
- Since:
- 8.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic CmsSimpleQueryFragmentcolumnEquals(String column, Object o) Creates an expression for comparing a column with a constant.static CmsSimpleQueryFragmentcolumnLike(String column, String str) Creates an expression for matching a column with a constant pattern.static voidfillParameters(PreparedStatement stmt, List<Object> params) Fills a given prepared statement with parameters from a list of objects.
-
Method Details
-
fillParameters
Fills a given prepared statement with parameters from a list of objects.- Parameters:
stmt- the prepared statementparams- the parameter objects- Throws:
SQLException- if something goes wrong
-
columnEquals
Creates an expression for comparing a column with a constant.- Parameters:
column- the column nameo- the constant- Returns:
- the query expression
-
columnLike
Creates an expression for matching a column with a constant pattern.- Parameters:
column- the column namestr- the pattern string- Returns:
- the query expression
-