protected QueryExecution createQueryExecution(Query q) throws SQLException {
if (this.remoteConn.getQueryEndpoint() == null)
throw new SQLException("This statement is backed by a write-only connection, read operations are not supported");
// Create basic execution
QueryEngineHTTP exec = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(this.remoteConn.getQueryEndpoint(), q);
// Apply authentication settings
if (this.authenticator != null) {
exec.setAuthenticator(this.authenticator);
}
// Apply default and named graphs if appropriate
if (this.remoteConn.getDefaultGraphURIs() != null) {
exec.setDefaultGraphURIs(this.remoteConn.getDefaultGraphURIs());
}
if (this.remoteConn.getNamedGraphURIs() != null) {
exec.setNamedGraphURIs(this.remoteConn.getNamedGraphURIs());
}
// Set result types
if (this.remoteConn.getSelectResultsType() != null) {
exec.setSelectContentType(this.remoteConn.getSelectResultsType());
}
if (this.remoteConn.getModelResultsType() != null) {
exec.setModelContentType(this.remoteConn.getModelResultsType());
}
// Return execution
return exec;
}