takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

Provide a way to customize the DatabaseConfig #26

Closed smougenot closed 9 years ago

smougenot commented 11 years ago

For particular DBs it might be necessary to adjust behaviours using DatabaseConfig. ex : a custom DataTypeFactory for use in Sybase (date fields are "specials")

For exemple : Add a way to specify a "listener" that would have a method with the DatabaseConfig passed as a parameters.

Some code could be

void configureConnection(final IDatabaseConnection datasourceConnection) {
        final DatabaseConfig config = datasourceConnection.getConfig();

        // batch
        config.setProperty(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, true);

        // types
        config.setProperty(DatabaseConfig.FEATURE_DATATYPE_WARNING, true);
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new  DataTypeFactoryPatch());
    }

If I've some time I'll create a pull request.

rsertelon commented 9 years ago

Hi @smougenot Is this issue still relevant?

rsertelon commented 9 years ago

No answer in two weeks, I'm closing this issue that is already more than a year old.

If needed, just reopen it.