com.ninja_squad.dbsetup.bind
Class DefaultBinderConfiguration
java.lang.Object
com.ninja_squad.dbsetup.bind.DefaultBinderConfiguration
- All Implemented Interfaces:
- BinderConfiguration
public class DefaultBinderConfiguration
- extends java.lang.Object
- implements BinderConfiguration
Default implementation of BinderConfiguration
, used by default by DbSetup
.
Method Summary |
Binder |
getBinder(java.sql.ParameterMetaData metadata,
int param)
Uses the parameter type of the given parameter and returns the following Binders depending on the type
got from the metadata. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
INSTANCE
public static final DefaultBinderConfiguration INSTANCE
- A shareable, reusable instance of this class.
DefaultBinderConfiguration
protected DefaultBinderConfiguration()
- Constructor. Protected because it doesn't make much sense to instantiate this class,
but extending it can be useful.
getBinder
public Binder getBinder(java.sql.ParameterMetaData metadata,
int param)
throws java.sql.SQLException
- Uses the parameter type of the given parameter and returns the following Binders depending on the type
got from the metadata.
- VARCHAR, CHAR, LONGNVARCHAR, LONGVARCHAR, NCHAR, NVARCHAR :
Binders.stringBinder()
- DATE :
Binders.dateBinder()
- TIME :
Binders.timeBinder()
- TIMESTAMP :
Binders.timestampBinder()
- INTEGER, BIGINT, SMALLINT, TINYINT :
Binders.integerBinder()
- DECIMAL, DOUBLE, FLOAT, NUMERIC, REAL :
Binders.decimalBinder()
- other :
Binders.defaultBinder()
- Specified by:
getBinder
in interface BinderConfiguration
- Parameters:
metadata
- the metadata allowing to decide which Binder to returnparam
- the param for which a binder is requested
- Returns:
- the binder for the given param and its metadata
- Throws:
java.sql.SQLException
- if a SQLException occurs while using the metadata
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object