use of org.dbflute.logic.jdbc.urlanalyzer.DfUrlAnalyzer in project dbflute-core by dbflute.
the class DfReplaceSchemaProperties method getAdditionalDropSchema.
public UnifiedSchema getAdditionalDropSchema(Map<String, Object> additionalDropMap) {
final String url = getAdditionalDropUrl(additionalDropMap);
final String catalog;
if (Srl.is_NotNull_and_NotTrimmedEmpty(url)) {
final DfUrlAnalyzerFactory factory = new DfUrlAnalyzerFactory(getBasicProperties(), url);
final DfUrlAnalyzer analyzer = factory.createAnalyzer();
catalog = analyzer.extractCatalog();
} else {
catalog = getDatabaseProperties().getDatabaseCatalog();
}
final Object obj = additionalDropMap.get("schema");
if (obj == null) {
if (!isDatabaseAsSchemaSpecificationOmittable()) {
String msg = "The schema is required:";
msg = msg + " additionalDropMap=" + additionalDropMap;
throw new DfRequiredPropertyNotFoundException(msg);
}
return null;
}
final String schema = castToString(obj, "additionalDropMapList.schema");
final UnifiedSchema unifiedSchema = UnifiedSchema.createAsDynamicSchema(catalog, schema);
return unifiedSchema;
}
use of org.dbflute.logic.jdbc.urlanalyzer.DfUrlAnalyzer in project dbflute-core by dbflute.
the class DfUrlAnalyzerDerbyTest method test_extractCatalog_nopath.
public void test_extractCatalog_nopath() throws Exception {
// ## Arrange ##
DfUrlAnalyzer analyzer = createTarget("jdbc:derby:exampledb;create=true");
// ## Act ##
String catalog = analyzer.extractCatalog();
// ## Assert ##
assertEquals("exampledb", catalog);
}
use of org.dbflute.logic.jdbc.urlanalyzer.DfUrlAnalyzer in project dbflute-core by dbflute.
the class DfUrlAnalyzerDerbyTest method test_extractCatalog_basic.
public void test_extractCatalog_basic() throws Exception {
// ## Arrange ##
DfUrlAnalyzer analyzer = createTarget("jdbc:derby:../src/main/resources/exampledb;create=true");
// ## Act ##
String catalog = analyzer.extractCatalog();
// ## Assert ##
assertEquals("exampledb", catalog);
}
use of org.dbflute.logic.jdbc.urlanalyzer.DfUrlAnalyzer in project dbflute-core by dbflute.
the class DfUrlAnalyzerDB2Test method test_extractCatalog_option.
public void test_extractCatalog_option() throws Exception {
// ## Arrange ##
DfUrlAnalyzer analyzer = createTarget("jdbc:db2://localhost:50000/exampledb?charSet=UTF-8");
// ## Act ##
String catalog = analyzer.extractCatalog();
// ## Assert ##
assertEquals("exampledb", catalog);
}
use of org.dbflute.logic.jdbc.urlanalyzer.DfUrlAnalyzer in project dbflute-core by dbflute.
the class DfUrlAnalyzerDB2Test method test_extractCatalog_basic.
public void test_extractCatalog_basic() throws Exception {
// ## Arrange ##
DfUrlAnalyzer analyzer = createTarget("jdbc:db2://localhost:50000/exampledb");
// ## Act ##
String catalog = analyzer.extractCatalog();
// ## Assert ##
assertEquals("exampledb", catalog);
}
Aggregations