DbUnitTask reports wrong name if factory is not found?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DbUnitTask reports wrong name if factory is not found?

Ostermueller, Erik-2
DbUnitTask reports wrong name if factory is not found?

Hello all,

The following code is the last part of the createConnection() method in In org\dbunit\ant\DbUnitTask.java from dbUnit 2.2.

The three catch clauses each report the name of the driver.
Instead of 'driver', shouldn't this be 'this.dataTypeFactory' or similar?

Thanks for a great tool,

--Erik


        IDatabaseConnection connection = new DatabaseConnection(conn, schema);
        DatabaseConfig config = connection.getConfig();
        config.setFeature(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, supportBatchStatement);
        config.setFeature(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, useQualifiedTableNames);
        config.setFeature(DatabaseConfig.FEATURE_DATATYPE_WARNING, datatypeWarning);
        config.setProperty(DatabaseConfig.PROPERTY_ESCAPE_PATTERN, escapePattern);
        config.setProperty(DatabaseConfig.PROPERTY_RESULTSET_TABLE_FACTORY,
                new ForwardOnlyResultSetTableFactory());

        // Setup data type factory
        try
        {
            IDataTypeFactory dataTypeFactory = (IDataTypeFactory)Class.forName(
                    this.dataTypeFactory).newInstance();
            config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, dataTypeFactory);
        }
        catch (ClassNotFoundException e)
        {
            throw new BuildException("Class Not Found: DataType factory "
                    + driver + " could not be loaded", e, location);
        }
        catch (IllegalAccessException e)
        {
            throw new BuildException("Illegal Access: DataType factory "
                    + driver + " could not be loaded", e, location);
        }
        catch (InstantiationException e)
        {
            throw new BuildException("Instantiation Exception: DataType factory "
                    + driver + " could not be loaded", e, location);
        }

        return connection;

______________

The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user