Examples of MemConnection


Examples of org.apache.jena.jdbc.mem.connections.MemConnection

*/
public class TestMemStatements extends AbstractJenaStatementTests {

    @Override
    protected JenaConnection getConnection() throws SQLException {
        return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY, false, Connection.TRANSACTION_NONE, JdbcCompatibility.DEFAULT);
    }
View Full Code Here

Examples of org.apache.jena.jdbc.mem.connections.MemConnection

*/
public class TestDatasetConnectionMetadata extends AbstractDatabaseMetadataTests {

    @Override
    protected JenaConnection getConnection() throws SQLException {
        return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY,
                JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL, JdbcCompatibility.DEFAULT);
    }
View Full Code Here

Examples of org.apache.jena.jdbc.mem.connections.MemConnection

*/
public class TestDatasetConnection extends AbstractJenaConnectionTests {

    @Override
    protected JenaConnection getConnection() throws SQLException {
        return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY,
                JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL, JdbcCompatibility.DEFAULT);
    }
View Full Code Here

Examples of org.apache.jena.jdbc.mem.connections.MemConnection

                JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL, JdbcCompatibility.DEFAULT);
    }

    @Override
    protected JenaConnection getConnection(Dataset ds) throws SQLException {
        return new MemConnection(ds, JenaConnection.DEFAULT_HOLDABILITY, JenaConnection.DEFAULT_AUTO_COMMIT,
                JenaConnection.DEFAULT_ISOLATION_LEVEL, JdbcCompatibility.DEFAULT);
    }
View Full Code Here

Examples of org.apache.jena.jdbc.mem.connections.MemConnection

                    + " 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");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.