com.ninja_squad.dbsetup.bind
Class Binders

java.lang.Object
  extended by com.ninja_squad.dbsetup.bind.Binders

public final class Binders
extends java.lang.Object

Utility class allowing to get various kinds of binders. The DefaultBinderConfiguration uses binders returned by this class, based on the type of the parameter.


Method Summary
static Binder dateBinder()
          Returns a binder suitable for columns of type DATE.
static Binder decimalBinder()
          Returns a binder suitable for numeric, decimal columns.
static Binder defaultBinder()
          Returns the default binder.
static Binder integerBinder()
          Returns a binder suitable for numeric, integer columns.
static Binder stringBinder()
          Returns a binder suitable for columns of type CHAR and VARCHAR.
static Binder timeBinder()
          Returns a binder suitable for columns of type TIME.
static Binder timestampBinder()
          Returns a binder suitable for columns of type TIMESTAMP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

defaultBinder

public static Binder defaultBinder()
Returns the default binder. This binder is normally used for columns of a type that is not handled by the other binders. It is also used when the metadata are not used and the Insert thus doesn't know the type of the column. It simply uses stmt.setObject() to bind the parameter, except if the value being bound is of some some well-known type not handled by JDBC:


stringBinder

public static Binder stringBinder()
Returns a binder suitable for columns of type CHAR and VARCHAR. The returned binder supports values of type


dateBinder

public static Binder dateBinder()
Returns a binder suitable for columns of type DATE. The returned binder supports values of type If the value is none of these types, stmt.setObject() is used to bind the value.


timestampBinder

public static Binder timestampBinder()
Returns a binder suitable for columns of type TIMESTAMP. The returned binder supports values of type If the value is none of these types, stmt.setObject() is used to bind the value.


timeBinder

public static Binder timeBinder()
Returns a binder suitable for columns of type TIME. The returned binder supports values of type If the value is none of these types, stmt.setObject() is used to bind the value.


decimalBinder

public static Binder decimalBinder()
Returns a binder suitable for numeric, decimal columns. The returned binder supports values of type If the value is none of these types, stmt.setObject() is used to bind the value.


integerBinder

public static Binder integerBinder()
Returns a binder suitable for numeric, integer columns. The returned binder supports values of type If the value is none of these types, stmt.setObject() is used to bind the value.