Package com.hp.hpl.jena.sdb.sql

Examples of com.hp.hpl.jena.sdb.sql.SDBConnection


   
    public static void query(String queryString, StoreDesc storeDesc, Connection jdbcConnection)
    {
        Query query = QueryFactory.create(queryString) ;

        SDBConnection conn = new SDBConnection(jdbcConnection) ;
       
        Store store = StoreFactory.create(storeDesc, conn) ;
       
        Dataset ds = DatasetStore.create(store) ;
        QueryExecution qe = QueryExecutionFactory.create(query, ds) ;
View Full Code Here


        java.sql.Connection conn = SDBFactory.createSqlConnection("sdb.ttl") ;
       
       
        boolean explicitTransactions = false ;
        {
            SDBConnection sConn1 = SDBConnectionFactory.create(conn) ;
            Store store1 = StoreFactory.create(desc, sConn1) ;
           
            if ( explicitTransactions )
                store1.getConnection().getTransactionHandler().begin() ;
           
            Graph graph1 = SDBFactory.connectDefaultGraph(store1) ;
            graph1.clear() ;
            SSE.write(graph1) ; System.out.println();
            graph1.add(t1) ;
            SSE.write(graph1) ; System.out.println();
           
            // Look for temporary tables.
            TableUtils.hasTable(sConn1.getSqlConnection(), "#NNodeTriples", new String[0]) ;

            if ( explicitTransactions )
                store1.getConnection().getTransactionHandler().commit() ;
           
            //store1.close() ;
           
        }      
       
        // Mythically return conn to the pool.
        // Get from pool
        // i.e. same connection.  Make a store around it
       
        {
            SDBConnection sConn2 = SDBConnectionFactory.create(conn) ;
            Store store2 = StoreFactory.create(desc, sConn2) ;

            if ( explicitTransactions )
                store2.getConnection().getTransactionHandler().begin() ;
           
View Full Code Here

     * @param theConfig the app configuration
     * @param jdbcConn  the JDBC connection
     * @return the SDB store
     */
    private Store getSDBStore(Map<String, Object> theConfig, Connection jdbcConn) {
        SDBConnection conn;
        Store store = null;
        if (null != jdbcConn) {
            conn = new SDBConnection(jdbcConn);
            //store.getLoader().setUseThreading(true);
            //store.getLoader().setChunkSize(128);
            //@TODO cache the StoreDesc ?, Store (theyre lightweight, maybe not much advantage)
            String layout = theConfig.containsKey(LAYOUT_TYPE) ? theConfig.get(LAYOUT_TYPE).toString() : LayoutType.LayoutTripleNodesIndex.getName();
            String databaseType = theConfig.containsKey(DATABASE_TYPE) ? theConfig.get(DATABASE_TYPE).toString() : DatabaseType.MySQL.getName();
View Full Code Here

     * @param theConfig the app config
     * @param jdbcConn the JDBC connectino for SDB
     * @return the SDB store
     */
    private Store getSDBStore(Map<String, Object> theConfig, DataSource jdbcConn) {
        SDBConnection conn = null;
        Store store = null;
        if (null != jdbcConn) {
            try {
                conn = new SDBConnection(jdbcConn);
            }
            catch (SQLException e) {
                e.printStackTrace();
            }
            //store.getLoader().setUseThreading(true);
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sdb.sql.SDBConnection

Copyright © 2018 www.massapicom. 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.