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
ConstructorsConstructorDescriptionCreates aPreparedStatementBinder.DefaultPreparedStatementBinder(DatabaseType databaseType) Creates aPreparedStatementBinderfor the givendatabaseType.DefaultPreparedStatementBinder(DatabaseType databaseType, ZoneId timeZone) Creates aPreparedStatementBinderfor the givendatabaseType.DefaultPreparedStatementBinder(ZoneId timeZone) Creates aPreparedStatementBinderfor the giventimeZone. -
Method Summary
Modifier and TypeMethodDescription<T> voidbind(StatementContext<T> statementContext, PreparedStatement preparedStatement, List<Object> parameters) Binds parameters to a SQL prepared statement.
-
Constructor Details
-
DefaultPreparedStatementBinder
public DefaultPreparedStatementBinder()Creates aPreparedStatementBinder. -
DefaultPreparedStatementBinder
Creates aPreparedStatementBinderfor the givendatabaseType.- Parameters:
databaseType- the type of database we're working with
-
DefaultPreparedStatementBinder
Creates aPreparedStatementBinderfor the giventimeZone.- Parameters:
timeZone- the timezone to use when working withTimestampand similar values
-
DefaultPreparedStatementBinder
public DefaultPreparedStatementBinder(@Nullable DatabaseType databaseType, @Nullable ZoneId timeZone) Creates aPreparedStatementBinderfor the givendatabaseType.- Parameters:
databaseType- the type of database we're working withtimeZone- the timezone to use when working withTimestampand 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:PreparedStatementBinderBinds parameters to a SQL prepared statement.- Specified by:
bindin interfacePreparedStatementBinder- Parameters:
statementContext- current SQL contextpreparedStatement- the prepared statement to bind toparameters- the parameters to bind to thePreparedStatement, if any
-