com.ninja_squad.dbsetup.bind
Interface BinderConfiguration

All Known Implementing Classes:
DefaultBinderConfiguration

public interface BinderConfiguration

An object which returns the appropriate Binder based on the metadata of the prepared statement. The default instance of this interface is DefaultBinderConfiguration. If the binders returned by this default configuration don't fit for the particular database you're using, or if you would like the binders returned by the configuration to support additional data types, you might want to provide a different implementation of this interface to the DbSetup.

It's advised to make implementations of this interface immutable, and to make them implement equals and hashCode in order for DbSetupTracker to function properly, or to make them singletons.


Method Summary
 Binder getBinder(java.sql.ParameterMetaData metadata, int param)
          Returns the appropriate Binder for the given parameter, based on the given metadata.
 

Method Detail

getBinder

Binder getBinder(@Nullable
                 java.sql.ParameterMetaData metadata,
                 int param)
                 throws java.sql.SQLException
Returns the appropriate Binder for the given parameter, based on the given metadata.

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