public final class NamedPreparedStatement
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
execute(java.sql.CallableStatement cs,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap,
java.util.Map<java.lang.String,?> inParams,
java.util.Map<java.lang.String,java.lang.Integer> outParams)
Execute the CallableStatement using the given values for bind parameters.
|
static boolean |
execute(java.sql.PreparedStatement ps,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap,
java.util.Map<java.lang.String,?> parameters)
Execute the PreparedStatement using the given values for bind
parameters.
|
static java.util.Iterator<java.lang.Integer> |
getPositions(java.lang.String name,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap)
get position for named bind variable.
|
static java.lang.String |
replaceBindParams(java.lang.String rawSQL,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap)
Given a SQL query with named bind parameters convert it to a format
that can be used with JDBC.
|
public static java.lang.String replaceBindParams(java.lang.String rawSQL,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap)
rawSQL - the SQL statement to create.parameterMap - a result map representing named parameters and
their positions in the SQL statement.public static boolean execute(java.sql.CallableStatement cs,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap,
java.util.Map<java.lang.String,?> inParams,
java.util.Map<java.lang.String,java.lang.Integer> outParams)
throws java.lang.RuntimeException
cs - The CallableStatement to executeparameterMap - The Map returned setup by replaceBindParamsinParams - A map of parameter name to input value to bind to the
statement.outParams - A map of parameter name to Integer object of
SQL Types representing the type of data to be returned.java.lang.RuntimeException - in case of SQLExceptionpublic static boolean execute(java.sql.PreparedStatement ps,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap,
java.util.Map<java.lang.String,?> parameters)
ps - The PreparedStatement to executeparameterMap - The Map returned setup by replaceBindParamsparameters - The values to substitute for the named bind parametersjava.lang.RuntimeException - in case of SQLExceptionPreparedStatement.execute()public static java.util.Iterator<java.lang.Integer> getPositions(java.lang.String name,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> parameterMap)
throws BindVariableNotFoundException
name - Name of the bind variableparameterMap - Map of parameters.BindVariableNotFoundException - couldn't find bind variable