com.ninja_squad.dbsetup.bind
Class DefaultBinderConfiguration

java.lang.Object
  extended by 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.


Field Summary
static DefaultBinderConfiguration INSTANCE
          A shareable, reusable instance of this class.
 
Constructor Summary
protected DefaultBinderConfiguration()
          Constructor.
 
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
 

Field Detail

INSTANCE

public static final DefaultBinderConfiguration INSTANCE
A shareable, reusable instance of this class.

Constructor Detail

DefaultBinderConfiguration

protected DefaultBinderConfiguration()
Constructor. Protected because it doesn't make much sense to instantiate this class, but extending it can be useful.

Method Detail

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. If the parameter type can't be obtained from the metadata, the default binder is returned.

Specified by:
getBinder in interface BinderConfiguration
Parameters:
metadata - the metadata allowing to decide which Binder to return. null if the Insert has been configured to not use metadata, or if the JDBC driver returned null metadata, or the JDBC driver threw a SQLException when asked for the metadata
param - 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