Package lumis.util
Class JdbcUtil
- java.lang.Object
-
- lumis.util.JdbcUtil
-
public class JdbcUtil extends Object
Utility class for JDBC operations.- Since:
- 4.0.0
- Version:
- $Revision: 24813 $ $Date: 2022-01-19 00:05:05 -0300 (Wed, 19 Jan 2022) $
-
-
Constructor Summary
Constructors Constructor Description JdbcUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static List<String>
fillListString(PreparedStatement statement, String fieldName)
static String[]
fillStringArray(PreparedStatement statement, String fieldName)
static String
generateInClause(int numItems)
Deprecated.Since 4.2.2.090330 replaced bygenerateInClause(String, int)
.static String
generateInClause(String fieldName, int numItems)
Generates a SQL IN statement for a field.static String
generateInlineInClause(String fieldName, Collection<String> values)
Generates a SQL IN statement for a field.static Timestamp
getTimestampByDate(Date data)
static String
prepareLargeTextCompareField(String fieldName)
static String
prepareQueryParameter(String parameter)
static void
setLargeFetchSize(Statement statement)
Sets a statement'sfetch size
to a standard large value.
-
-
-
Method Detail
-
prepareQueryParameter
public static String prepareQueryParameter(String parameter) throws PortalException
- Throws:
PortalException
-
fillStringArray
public static String[] fillStringArray(PreparedStatement statement, String fieldName) throws SQLException
- Throws:
SQLException
-
fillListString
public static List<String> fillListString(PreparedStatement statement, String fieldName) throws SQLException
- Throws:
SQLException
-
generateInClause
@Deprecated public static String generateInClause(int numItems)
Deprecated.Since 4.2.2.090330 replaced bygenerateInClause(String, int)
.
-
generateInClause
public static String generateInClause(String fieldName, int numItems)
Generates a SQL IN statement for a field. The IN statement is generated using?
for each parameter, according to thenumItems
argument.- Parameters:
fieldName
- the field operand before the IN operator (e.g.: columnName or table.column).numItems
- the number of parameters to be included in the IN statement.- Returns:
- the SQL code fragment for the IN statement.
- Since:
- 4.2.2.090330
-
generateInlineInClause
public static String generateInlineInClause(String fieldName, Collection<String> values) throws PortalException
Generates a SQL IN statement for a field. The IN statement is generated using in-line value for each item, according to thevalues
argument.- Parameters:
fieldName
- the field operand before the IN operator (e.g.: columnName or table.column).values
- the values to be included in the IN statement.- Returns:
- the SQL code fragment for the IN statement.
- Throws:
PortalException
- Since:
- 10.3.0
-
setLargeFetchSize
public static void setLargeFetchSize(Statement statement) throws SQLException
Sets a statement'sfetch size
to a standard large value.- Parameters:
statement
- the statement.- Throws:
SQLException
- if an thrown by the JDBC driver.- Since:
- 10.0.0
-
prepareLargeTextCompareField
public static String prepareLargeTextCompareField(String fieldName)
Properly convert SQL Text fields for comparisons in queries.
- Parameters:
fieldName
- the name of the field to be wrapped in the conversion statement, including the table aliases.- Returns:
- The fieldName wrapped in the conversion statement when applicable
- Since:
- 10.0.0
-
-