Package com.pyranid
Class DefaultPreparedStatementBinder
java.lang.Object
com.pyranid.DefaultPreparedStatementBinder
- All Implemented Interfaces:
PreparedStatementBinder
@ThreadSafe
public class DefaultPreparedStatementBinder
extends Object
implements PreparedStatementBinder
Basic implementation of
PreparedStatementBinder
.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Constructor Summary
ConstructorDescriptionCreates aPreparedStatementBinder
.DefaultPreparedStatementBinder
(DatabaseType databaseType) Creates aPreparedStatementBinder
for the givendatabaseType
.DefaultPreparedStatementBinder
(DatabaseType databaseType, ZoneId timeZone) Creates aPreparedStatementBinder
for the givendatabaseType
.DefaultPreparedStatementBinder
(ZoneId timeZone) Creates aPreparedStatementBinder
for the giventimeZone
. -
Method Summary
Modifier and TypeMethodDescription<T> void
bind
(StatementContext<T> statementContext, PreparedStatement preparedStatement, List<Object> parameters) Binds parameters to a SQL prepared statement.
-
Constructor Details
-
DefaultPreparedStatementBinder
public DefaultPreparedStatementBinder()Creates aPreparedStatementBinder
. -
DefaultPreparedStatementBinder
Creates aPreparedStatementBinder
for the givendatabaseType
.- Parameters:
databaseType
- the type of database we're working with
-
DefaultPreparedStatementBinder
Creates aPreparedStatementBinder
for the giventimeZone
.- Parameters:
timeZone
- the timezone to use when working withTimestamp
and similar values
-
DefaultPreparedStatementBinder
public DefaultPreparedStatementBinder(@Nullable DatabaseType databaseType, @Nullable ZoneId timeZone) Creates aPreparedStatementBinder
for the givendatabaseType
.- Parameters:
databaseType
- the type of database we're working withtimeZone
- the timezone to use when working withTimestamp
and similar values- Since:
- 1.0.15
-
-
Method Details
-
bind
public <T> void bind(@Nonnull StatementContext<T> statementContext, @Nonnull PreparedStatement preparedStatement, @Nonnull List<Object> parameters) Description copied from interface:PreparedStatementBinder
Binds parameters to a SQL prepared statement.- Specified by:
bind
in interfacePreparedStatementBinder
- Parameters:
statementContext
- current SQL contextpreparedStatement
- the prepared statement to bind toparameters
- the parameters to bind to thePreparedStatement
, if any
-