class DefaultBinderConfiguration implements BinderConfiguration {

    @Override
    public Binder getBinder(ParameterMetaData metadata, int param) throws SQLException {
        if (metadata == null) {
            return Binders.defaultBinder();
        }
        try {
            int sqlType = metadata.getParameterType(param);
            if (sqlType == Types.DATE) {
                return Binders.dateBinder();
            }
            if (sqlType == Types.TIME || sqlType == Types.TIME_WITH_TIMEZONE) {
                return Binders.timeBinder();
            }
            if (sqlType == Types.TIMESTAMP || sqlType == Types.TIMESTAMP_WITH_TIMEZONE) {
                return Binders.timestampBinder();
            }
            if (sqlType == Types.BIGINT
                || sqlType == Types.INTEGER
                || sqlType == Types.SMALLINT
                || sqlType == Types.TINYINT) {
                return Binders.integerBinder();
            }
            if (sqlType == Types.DECIMAL
                || sqlType == Types.DOUBLE
                || sqlType == Types.FLOAT
                || sqlType == Types.NUMERIC
                || sqlType == Types.REAL) {
                return Binders.decimalBinder();
            }
            if (sqlType == Types.VARCHAR
                || sqlType == Types.CHAR
                || sqlType == Types.LONGNVARCHAR
                || sqlType == Types.LONGVARCHAR
                || sqlType == Types.NCHAR
                || sqlType == Types.NVARCHAR) {
                return Binders.stringBinder();
            }
            return Binders.defaultBinder();
        }
        catch (SQLException e) {
            // the database can't return types from parameters. Fall back to default binder.
            return Binders.defaultBinder();
        }
    }

    protected  DefaultBinderConfiguration();

}