本文整理汇总了Java中org.dbunit.ext.postgresql.PostgresqlDataTypeFactory类的典型用法代码示例。如果您正苦于以下问题:Java PostgresqlDataTypeFactory类的具体用法?Java PostgresqlDataTypeFactory怎么用?Java PostgresqlDataTypeFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostgresqlDataTypeFactory类属于org.dbunit.ext.postgresql包,在下文中一共展示了PostgresqlDataTypeFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createConnection
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
@Override
public IDatabaseConnection createConnection(final Connection connection) throws DatabaseUnitException {
final IDatabaseConnection dbUnitConnection = new DatabaseConnection(connection);
dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
return dbUnitConnection;
}
开发者ID:dadrus,项目名称:jpa-unit,代码行数:8,代码来源:PostgresqlConnectionFactory.java
示例2: init
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
@PostConstruct
void init() throws SQLException, DatabaseUnitException {
new File(root).mkdirs();
conn = new DatabaseConnection(dataSource.getConnection());
DatabaseConfig config = conn.getConfig();
switch (driver) {
case "com.mysql.jdbc.Driver":
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
break;
case "org.postgresql.Driver":
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
break;
default:
log.info("Not support database: " + driver);
}
}
开发者ID:chonglou,项目名称:itpkg,代码行数:17,代码来源:BackupJob.java
示例3: connectionRetrieved
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
@Override
public void connectionRetrieved(final IDatabaseConnection connection) {
final DatabaseConfig config = connection.getConfig();
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
config.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);
config.setProperty(DatabaseConfig.PROPERTY_BATCH_SIZE, 300);
config.setProperty(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, true);
}
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:9,代码来源:DBUnitLoaderTestExecutionListener.java
示例4: createConnection
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
/**
* Geeft een door DBUnit gewrapte connectie terug naar de testdatabase.
* @return Een DBUnit {@link IDatabaseConnection} naar de testdatabase.
* @throws SQLException on error
* @throws DatabaseUnitException on error
*/
public IDatabaseConnection createConnection() throws DatabaseUnitException, SQLException {
final IDatabaseConnection connection = new DatabaseConnection(createSqlConnection());
final DatabaseConfig config = connection.getConfig();
config.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, Boolean.TRUE);
config.setProperty(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, Boolean.TRUE);
config.setProperty(DatabaseConfig.PROPERTY_BATCH_SIZE, INT_5000);
if (inMemory) {
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());
} else {
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
}
return connection;
}
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:20,代码来源:AbstractDBUnitUtil.java
示例5: configDatabaseProperties
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
private void configDatabaseProperties() throws SQLException {
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());
}
}
switch (dbType) {
case HSQLDB:
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());
break;
case H2:
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
break;
case MYSQL:
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
break;
case POSTGRESQL:
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
break;
case ORACLE:
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory());
break;
}
}
开发者ID:database-rider,项目名称:database-rider,代码行数:28,代码来源:RiderDataSource.java
示例6: createProgresConnection
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
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;
}
开发者ID:proarc,项目名称:proarc,代码行数:10,代码来源:DbUnitSupport.java
示例7: create
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; //导入依赖的package包/类
@Override
public IDatabaseConnection create() {
try {
IDatabaseConnection dbUnitConn = new DatabaseConnection(getConnection());
dbUnitConn.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
return dbUnitConn;
} catch (DatabaseUnitException e) {
throw new IllegalStateException(
"It's not possible to create a PostgreSql DbUnit connection: "
+ e.getMessage(), e);
}
}
开发者ID:rponte,项目名称:dbunitmanager,代码行数:13,代码来源:PostgreSqlDbUnitConnectionCreator.java
注:本文中的org.dbunit.ext.postgresql.PostgresqlDataTypeFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论