use of org.apache.jena.sdb.sql.SDBConnectionDesc in project jena by apache.
the class SDBConnectionDescAssembler method open.
@Override
public SDBConnectionDesc open(Assembler a, Resource root, Mode mode) {
SDBConnectionDesc sDesc = SDBConnectionDesc.blank();
sDesc.setType(GraphUtils.getStringValue(root, AssemblerVocab.pSDBtype));
sDesc.setHost(GraphUtils.getStringValue(root, AssemblerVocab.pSDBhost));
sDesc.setName(GraphUtils.getStringValue(root, AssemblerVocab.pSDBname));
sDesc.setUser(GraphUtils.getStringValue(root, AssemblerVocab.pSDBuser));
sDesc.setPassword(GraphUtils.getStringValue(root, AssemblerVocab.pSDBpassword));
sDesc.setDriver(GraphUtils.getStringValue(root, AssemblerVocab.pDriver));
sDesc.setJdbcURL(GraphUtils.getStringValue(root, AssemblerVocab.pJDBC));
sDesc.setPoolSize(GraphUtils.getStringValue(root, AssemblerVocab.pPoolSize));
sDesc.setLabel(GraphUtils.getStringValue(root, RDFS.label));
if (sDesc.getUser() == null)
sDesc.setUser(Access.getUser());
if (sDesc.getPassword() == null)
sDesc.setPassword(Access.getPassword());
return sDesc;
}
use of org.apache.jena.sdb.sql.SDBConnectionDesc in project jena by apache.
the class StoreDescAssembler method open.
@Override
public StoreDesc open(Assembler a, Resource root, Mode mode) {
SDBConnectionDesc sdbConnDesc = null;
Resource c = GraphUtils.getResourceValue(root, AssemblerVocab.pConnection);
if (c != null)
sdbConnDesc = (SDBConnectionDesc) a.open(c);
String layoutName = GraphUtils.getStringValue(root, AssemblerVocab.pLayout);
String dbType = chooseDBType(root, sdbConnDesc);
// Features
List<Resource> x = GraphUtils.multiValueResource(root, AssemblerVocab.featureProperty);
FeatureSet fSet = new FeatureSet();
for (Resource r : x) {
String n = GraphUtils.getStringValue(r, AssemblerVocab.featureNameProperty);
String v = GraphUtils.getStringValue(r, AssemblerVocab.featureValueProperty);
Feature f = new Feature(new Feature.Name(n), v);
fSet.addFeature(f);
}
StoreDesc storeDesc = new StoreDesc(layoutName, dbType, fSet);
storeDesc.connDesc = sdbConnDesc;
// MySQL specials
String engineName = GraphUtils.getStringValue(root, AssemblerVocab.pMySQLEngine);
storeDesc.engineType = null;
if (engineName != null)
try {
storeDesc.engineType = MySQLEngineType.convert(engineName);
} catch (SDBException ex) {
}
// SAP specials
String storageType = GraphUtils.getStringValue(root, AssemblerVocab.pStorageType);
if (storageType != null)
try {
storeDesc.storageType = SAPStorageType.convert(storageType);
} catch (SDBException ex) {
}
return storeDesc;
}
Aggregations