Class PreparedStatementHelper
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.common.PreparedStatementHelper
-
public class PreparedStatementHelper extends java.lang.ObjectCollection of utility functions to simply setting values on a PreparedStatement
-
-
Constructor Summary
Constructors Constructor Description PreparedStatementHelper(java.sql.PreparedStatement ps)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBatch()Add a new batch entry based on the current state of thePreparedStatement.intregisterOutParameter(int parameterType)Register an OUT parameter, assuming the delegate is a CallableStatementPreparedStatementHelpersetBinaryStream(java.io.InputStream value)Set the (possibly null) InputStream value at the current position and increment the position by 1PreparedStatementHelpersetInt(java.lang.Integer value)Set the (possibly null) int value at the current position and increment the position by 1PreparedStatementHelpersetLong(java.lang.Long value)Set the (possibly null) long value at the current position and increment the position by 1PreparedStatementHelpersetShort(java.lang.Short value)Set the (possibly null) long value at the current position and increment the position by 1PreparedStatementHelpersetString(java.lang.String value)Set the (possibly null) String value at the current position and increment the position by 1PreparedStatementHelpersetTimestamp(java.sql.Timestamp value)Set the (possibly null) int value at the current position and increment the position by 1
-
-
-
Method Detail
-
setInt
public PreparedStatementHelper setInt(java.lang.Integer value) throws java.sql.SQLException
Set the (possibly null) int value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
setLong
public PreparedStatementHelper setLong(java.lang.Long value) throws java.sql.SQLException
Set the (possibly null) long value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
setShort
public PreparedStatementHelper setShort(java.lang.Short value) throws java.sql.SQLException
Set the (possibly null) long value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
setString
public PreparedStatementHelper setString(java.lang.String value) throws java.sql.SQLException
Set the (possibly null) String value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
setBinaryStream
public PreparedStatementHelper setBinaryStream(java.io.InputStream value) throws java.sql.SQLException
Set the (possibly null) InputStream value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
setTimestamp
public PreparedStatementHelper setTimestamp(java.sql.Timestamp value) throws java.sql.SQLException
Set the (possibly null) int value at the current position and increment the position by 1- Parameters:
value-- Returns:
- this instance
- Throws:
java.sql.SQLException
-
registerOutParameter
public int registerOutParameter(int parameterType) throws java.sql.SQLExceptionRegister an OUT parameter, assuming the delegate is a CallableStatement- Parameters:
parameterType- fromTypes- Returns:
- the parameter index of the OUT parameter
- Throws:
java.sql.SQLException
-
addBatch
public void addBatch() throws java.sql.SQLExceptionAdd a new batch entry based on the current state of thePreparedStatement. Note that we don't return this on purpose...because addBatch should be last in any sequence of setXX(...) calls.- Throws:
java.sql.SQLException
-
-