Error setting database config property for IDatabaseConnection (HSQLDB)

后端 未结 3 627
栀梦
栀梦 2021-01-21 01:04

I\'ve included fully testable code below, which generates the following error when supplied with a dataset xml containing empty fields. A sample dataset.xml

相关标签:
3条回答
  • 2021-01-21 01:19

    for me it's work:

            IDatabaseConnection dbConn = new DatabaseDataSourceConnection(getDataSource());
            dbConn.getConfig().setProperty(DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS, true);
            DatabaseOperation.CLEAN_INSERT.execute(dbConn, getiDataSet(loadDBData.source()));
    
    0 讨论(0)
  • 2021-01-21 01:35

    You must override method setUpDatabaseConfig(DatabaseConfig config) as follows:

    @Override
    protected void setUpDatabaseConfig(DatabaseConfig config) {
        config.setProperty(DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS, true); 
    }
    

    Hope it helps

    0 讨论(0)
  • 2021-01-21 01:37

    I've stumbled upon the correct answer, at least the one which solves my problem. It related to this line all along databaseTester.onSetup() which could simply be replaced with DatabaseOperation.CLEAN_INSERT.execute(iConn, dataSet);. Feel free comment on why this seemed to have fixed the error.

    0 讨论(0)
提交回复
热议问题