Java Code Examples for org.dbunit.database.DatabaseConfig

The following examples show how to use org.dbunit.database.DatabaseConfig. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public IDatabaseConnection getConnection() throws Exception {
    IDatabaseConnection result = super.getConnection();
    DatabaseConfig dbConfig = result.getConfig();
    dbConfig.setProperty(DatabaseConfig.FEATURE_CASE_SENSITIVE_TABLE_NAMES, false);
    dbConfig.setProperty(DatabaseConfig.FEATURE_DATATYPE_WARNING, false);
    if ("org.h2.Driver".equals(driverClass)) {
        dbConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
    } else if ("com.mysql.jdbc.Driver".equals(driverClass)) {
        dbConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
    } else if ("org.postgresql.Driver".equals(driverClass)) {
        dbConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
    } else if ("oracle.jdbc.driver.OracleDriver".equals(driverClass)) {
        dbConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory());
    } else if ("com.microsoft.sqlserver.jdbc.SQLServerDriver".equals(driverClass)) {
        dbConfig.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MsSqlDataTypeFactory());
        
    }
    return result;
}
 
Example 2
Source Project: database-rider   Source File: RiderDataSource.java    License: Apache License 2.0 6 votes vote down vote up
private void configDatabaseProperties() {
    DatabaseConfig config = dbUnitConnection.getConfig();
    for (Map.Entry<String, Object> p : dbUnitConfig.getProperties().entrySet()) {
        ConfigProperty byShortName = DatabaseConfig.findByShortName(p.getKey());
        if (byShortName != null) {
            config.setProperty(byShortName.getProperty(), p.getValue());
        }
    }

    if (!dbUnitConfig.getProperties().containsKey("datatypeFactory")) {
        IDataTypeFactory dataTypeFactory = getDataTypeFactory(dbType);
        if (dataTypeFactory != null) {
            config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, dataTypeFactory);
        }
    }
    if (!dbUnitConfig.getProperties().containsKey("metadataHandler")) {
        IMetadataHandler metadataHandler = getMetadataHandler(dbType);
        if (metadataHandler != null) {
            config.setProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER, metadataHandler);
        }
    }

}
 
Example 3
Source Project: jpa-unit   Source File: PostgresqlConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), not(equalTo(DefaultDataTypeFactory.class)));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 4
Source Project: jpa-unit   Source File: Oracle10ConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
@Ignore("oracle jdbc required in classpath")
public void testCreateConnection() throws DatabaseUnitException, SQLException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(Oracle10DataTypeFactory.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 5
Source Project: jpa-unit   Source File: NetezzaConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(NetezzaDataTypeFactory.class));

    final Object metadataHandler = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER);
    assertThat(metadataHandler, notNullValue());
    assertThat(metadataHandler.getClass(), equalTo(NetezzaMetadataHandler.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 6
Source Project: jpa-unit   Source File: H2ConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(H2DataTypeFactory.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 7
Source Project: jpa-unit   Source File: Db2ConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws Exception {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(Db2DataTypeFactory.class));

    final Object metadataHandler = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER);
    assertThat(metadataHandler, notNullValue());
    assertThat(metadataHandler.getClass(), equalTo(Db2MetadataHandler.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 8
Source Project: jpa-unit   Source File: McKoiConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(MckoiDataTypeFactory.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 9
Source Project: jpa-unit   Source File: MsSqlConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(MsSqlDataTypeFactory.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 10
Source Project: jpa-unit   Source File: HsqldbConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(HsqldbDataTypeFactory.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 11
Source Project: jpa-unit   Source File: MySqlConnectionFactoryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(MySqlDataTypeFactory.class));

    final Object metadataHandler = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER);
    assertThat(metadataHandler, notNullValue());
    assertThat(metadataHandler.getClass(), equalTo(MySqlMetadataHandler.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
}
 
Example 12
protected IDatabaseConnection getConnection() throws Exception {
    Properties cfg = getHibernateConfiguration();
    String username = cfg.getProperty("hibernate.connection.username");
    String password = cfg.getProperty("hibernate.connection.password");
    String driver = cfg.getProperty("hibernate.connection.driver_class");
    String url = cfg.getProperty("hibernate.connection.url");

    Class.forName(driver);

    Connection jdbcConnection = DriverManager.getConnection(url, username, password);

    IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
    DatabaseConfig config = connection.getConfig();
    // config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new
    // H2DataTypeFactory());
    config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());

    return connection;
}
 
Example 13
Source Project: kylin-on-parquet-v2   Source File: KylinTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
protected static H2Connection newH2Connection() throws DatabaseUnitException {
    H2Connection h2Conn = new H2Connection(h2Connection, null);
    h2Conn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new TestH2DataTypeFactory());
    h2Conn.getConfig().setFeature(DatabaseConfig.FEATURE_DATATYPE_WARNING, false);
    return h2Conn;
}
 
Example 14
Source Project: jpa-unit   Source File: NetezzaConnectionFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public IDatabaseConnection createConnection(final Connection connection, final String schema) throws DatabaseUnitException {
    final IDatabaseConnection dbUnitConnection = new DatabaseConnection(connection, schema);

    dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new NetezzaDataTypeFactory());
    dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER, new NetezzaMetadataHandler());

    return dbUnitConnection;
}
 
Example 15
Source Project: jpa-unit   Source File: Oracle10ConnectionFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public IDatabaseConnection createConnection(final Connection connection, final String schema) throws DatabaseUnitException {
    final DatabaseConnection dbUnitConnection = new DatabaseConnection(connection, schema);

    dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory());

    return dbUnitConnection;
}
 
Example 16
Source Project: jpa-unit   Source File: PostgresqlConnectionFactory.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public IDatabaseConnection createConnection(final Connection connection, final String schema) throws DatabaseUnitException {
    final IDatabaseConnection dbUnitConnection = new DatabaseConnection(connection, schema);

    dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());

    return dbUnitConnection;
}
 
Example 17
Source Project: jpa-unit   Source File: DbUnitConfigurationLoaderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void createDbUnitConfiguration() throws IOException {
    existingConfigFile = tmp.newFile();
    notExistingConfigFile = new File(UUID.randomUUID().toString());

    expectedConfig = new Properties();
    expectedConfig.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, "true");
    expectedConfig.setProperty(DatabaseConfig.PROPERTY_BATCH_SIZE, "1000");

    try (FileOutputStream out = new FileOutputStream(existingConfigFile)) {
        expectedConfig.store(out, "dbunit config");
    }
}
 
Example 18
Source Project: jpa-unit   Source File: DbUnitConfigurationLoaderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testLoadingConfigurationGivenAnExistingFile() throws MalformedURLException {
    // GIVEN
    final URL url = existingConfigFile.toURI().toURL();

    // WHEN
    final Properties configuration = DbUnitConfigurationLoader.loadConfiguration(url);

    // THEN
    assertThat(configuration.getProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES), equalTo("true"));
    assertThat(configuration.getProperty(DatabaseConfig.PROPERTY_BATCH_SIZE), equalTo("1000"));
    assertThat(configuration.keySet().size(), equalTo(2));
}
 
Example 19
Source Project: Zebra   Source File: SingleDBBaseTestCase.java    License: Apache License 2.0 5 votes vote down vote up
protected DatabaseOperation getSetUpOperation() throws Exception {
	parseCreateTableScriptFile();

	initSpringContext();

	return new CompositeOperation(new DatabaseOperation[] { new DatabaseOperation() {

		@Override
		public void execute(IDatabaseConnection connection, IDataSet dataSet)
				throws DatabaseUnitException, SQLException {

			DatabaseConfig databaseConfig = connection.getConfig();
			IStatementFactory statementFactory = (IStatementFactory) databaseConfig
					.getProperty(DatabaseConfig.PROPERTY_STATEMENT_FACTORY);
			IBatchStatement statement = statementFactory.createBatchStatement(connection);
			try {
				int count = 0;
				for (SingleCreateTableScriptEntry entry : createdTableList) {
					statement.addBatch(entry.getCreateTableScript());
					count++;
				}

				if (count > 0) {
					statement.executeBatch();
					statement.clearBatch();
				}
			} finally {
				statement.close();
			}
		}
	}, DatabaseOperation.CLEAN_INSERT });
}
 
Example 20
Source Project: Zebra   Source File: SingleDBBaseTestCase.java    License: Apache License 2.0 5 votes vote down vote up
protected DatabaseOperation getTearDownOperation() throws Exception {
	return new DatabaseOperation() {

		@Override
		public void execute(IDatabaseConnection connection, IDataSet dataSet)
				throws DatabaseUnitException, SQLException {

			DatabaseConfig databaseConfig = connection.getConfig();
			IStatementFactory statementFactory = (IStatementFactory) databaseConfig
					.getProperty(DatabaseConfig.PROPERTY_STATEMENT_FACTORY);
			IBatchStatement statement = statementFactory.createBatchStatement(connection);

			try {
				int count = 0;
				for (SingleCreateTableScriptEntry entry : createdTableList) {
					statement.addBatch("drop table " + entry.getTableName());
					count++;
				}

				if (count > 0) {
					statement.executeBatch();
					statement.clearBatch();
				}
			} finally {
				statement.close();
			}

		}
	};
}
 
Example 21
Source Project: proarc   Source File: DbUnitSupport.java    License: GNU General Public License v3.0 5 votes vote down vote up
private IDatabaseConnection createProgresConnection(Connection c) throws DatabaseUnitException {
    DatabaseConnection dbc = new DatabaseConnection(c);
    DatabaseConfig config = dbc.getConfig();
    config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
    // Progress cannot handle columns names like XML thus we have to escape them.
    config.setProperty(DatabaseConfig.PROPERTY_ESCAPE_PATTERN, "\"?\"");
    config.setProperty(DatabaseConfig.FEATURE_CASE_SENSITIVE_TABLE_NAMES, false);
    return dbc;
}
 
Example 22
Source Project: kylin   Source File: KylinTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
protected static H2Connection newH2Connection() throws DatabaseUnitException {
    H2Connection h2Conn = new H2Connection(h2Connection, null);
    h2Conn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new TestH2DataTypeFactory());
    h2Conn.getConfig().setFeature(DatabaseConfig.FEATURE_DATATYPE_WARNING, false);
    return h2Conn;
}
 
Example 23
Source Project: pnc   Source File: AbstractModelTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Inserts data into database from the dbunit XML file
 * 
 * @param em Entity manager
 * @param datasetPath Path to DBunit dataset file
 * @throws Exception Thrown in case of any error during the operation
 */
protected void initDatabaseUsingDataset(EntityManager em, String datasetPath) throws Exception {
    IDatabaseConnection connection = new DatabaseConnection(em.unwrap(SessionImpl.class).connection());
    connection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());
    FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder();
    flatXmlDataSetBuilder.setColumnSensing(true);
    InputStream dataSetStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(datasetPath);
    IDataSet dataSet = flatXmlDataSetBuilder.build(dataSetStream);
    DatabaseOperation.INSERT.execute(connection, dataSet);
}
 
Example 24
Source Project: Kylin   Source File: KylinTestBase.java    License: Apache License 2.0 5 votes vote down vote up
protected void execQueryUsingH2(String queryFolder, boolean needSort) throws Exception {
    printInfo("---------- Running H2 queries: " + queryFolder);

    List<File> sqlFiles = getFilesFromFolder(new File(queryFolder), ".sql");
    for (File sqlFile : sqlFiles) {
        String queryName = StringUtils.split(sqlFile.getName(), '.')[0];
        String sql = getTextFromFile(sqlFile);

        // execute H2
        printInfo("Query Result from H2 - " + queryName);
        H2Connection h2Conn = new H2Connection(h2Connection, null);
        h2Conn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new TestH2DataTypeFactory());
        executeQuery(h2Conn, queryName, sql, needSort);
    }
}
 
Example 25
Source Project: Kylin   Source File: KylinTestBase.java    License: Apache License 2.0 5 votes vote down vote up
protected void execAndCompQuery(String queryFolder, String[] exclusiveQuerys, boolean needSort) throws Exception {
    printInfo("---------- test folder: " + queryFolder);
    Set<String> exclusiveSet = buildExclusiveSet(exclusiveQuerys);

    List<File> sqlFiles = getFilesFromFolder(new File(queryFolder), ".sql");
    for (File sqlFile : sqlFiles) {
        String queryName = StringUtils.split(sqlFile.getName(), '.')[0];
        if (exclusiveSet.contains(queryName)) {
            continue;
        }
        String sql = getTextFromFile(sqlFile);

        // execute Kylin
        printInfo("Query Result from Kylin - " + queryName + "  (" + queryFolder + ")");
        IDatabaseConnection kylinConn = new DatabaseConnection(cubeConnection);
        ITable kylinTable = executeQuery(kylinConn, queryName, sql, needSort);

        // execute H2
        printInfo("Query Result from H2 - " + queryName);
        H2Connection h2Conn = new H2Connection(h2Connection, null);
        h2Conn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new TestH2DataTypeFactory());
        ITable h2Table = executeQuery(h2Conn, queryName, sql, needSort);

        // compare the result
        Assertion.assertEquals(h2Table, kylinTable);

        compQueryCount++;
        if (kylinTable.getRowCount() == 0) {
            zeroResultQueries.add(sql);
        }
    }
}
 
Example 26
Source Project: Kylin   Source File: KylinTestBase.java    License: Apache License 2.0 5 votes vote down vote up
protected void execAndCompDynamicQuery(String queryFolder, String[] exclusiveQuerys, boolean needSort) throws Exception {
    printInfo("---------- test folder: " + queryFolder);
    Set<String> exclusiveSet = buildExclusiveSet(exclusiveQuerys);

    List<File> sqlFiles = getFilesFromFolder(new File(queryFolder), ".sql");
    for (File sqlFile : sqlFiles) {
        String queryName = StringUtils.split(sqlFile.getName(), '.')[0];
        if (exclusiveSet.contains(queryName)) {
            continue;
        }
        String sql = getTextFromFile(sqlFile);
        List<String> parameters = getParameterFromFile(sqlFile);

        // execute Kylin
        printInfo("Query Result from Kylin - " + queryName + "  (" + queryFolder + ")");
        IDatabaseConnection kylinConn = new DatabaseConnection(cubeConnection);
        ITable kylinTable = executeDynamicQuery(kylinConn, queryName, sql, parameters, needSort);

        // execute H2
        printInfo("Query Result from H2 - " + queryName);
        IDatabaseConnection h2Conn = new DatabaseConnection(h2Connection);
        h2Conn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new TestH2DataTypeFactory());
        ITable h2Table = executeDynamicQuery(h2Conn, queryName, sql, parameters, needSort);

        // compare the result
        Assertion.assertEquals(h2Table, kylinTable);
    }
}
 
Example 27
Source Project: mycollab   Source File: DbUnitUtil.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    DataSource dataSource = new DataSourceFactoryBean().getDataSource();
    File file = new File("src/main/resources/mycollab.dtd");
    IDatabaseConnection connection = new DatabaseDataSourceConnection(dataSource);
    connection.getConfig().setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);
    // write DTD file
    FlatDtdDataSet.write(connection.createDataSet(), new FileOutputStream(file));
}
 
Example 28
public IDatabaseConnection getConnection() throws Exception {
            IDatabaseConnection connection = super.getConnection();
            DatabaseConfig config = connection.getConfig();
            config.setProperty(DatabaseConfig.FEATURE_CASE_SENSITIVE_TABLE_NAMES, false);
//            config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
            return connection;
        }
 
Example 29
public ConnectionConfigurator setDataTypeFactory(IDataTypeFactory dataTypeFactory) {
	return setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, dataTypeFactory);
}
 
Example 30
private void applyProperties(IDatabaseConnection connection) {
	DatabaseConfig dbConfig = connection.getConfig();
	properties.forEach(dbConfig::setProperty);
}