+ " connection parameters is present in the JDBC Connection URL or the provided Properties object");
if (dsObj != null) {
if (dsObj instanceof Dataset) {
// Dataset provided directly
return new MemConnection((Dataset) dsObj, JenaConnection.DEFAULT_HOLDABILITY, JenaConnection.DEFAULT_AUTO_COMMIT,
JenaConnection.DEFAULT_ISOLATION_LEVEL, compatibilityLevel);
} else {
// Load dataset from a file
try {
Dataset ds = DatasetFactory.createMem();
RDFDataMgr.read(ds, dsObj.toString());
return new MemConnection(ds, JenaConnection.DEFAULT_HOLDABILITY, JenaConnection.DEFAULT_AUTO_COMMIT,
JenaConnection.DEFAULT_ISOLATION_LEVEL, compatibilityLevel);
} catch (Exception e) {
throw new SQLException("Error occurred while reading from the specified RDF dataset file - "
+ dsObj.toString(), e);
}
}
} else if (this.isTrue(props, PARAM_EMPTY)) {
// Use an empty dataset
return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY,
JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL, compatibilityLevel);
} else {
throw new SQLException(
"Insufficient parameters to create a Jena JDBC in-memory connection, please supply a Dataset file/instance via the "
+ PARAM_DATASET + " parameter or supply " + PARAM_EMPTY + "=true to connect to a new empty dataset");