org.aksw.commons.sparql.api.cache.extra
Class CacheCoreH2

java.lang.Object
  extended by org.aksw.commons.sparql.api.cache.extra.SqlDaoBase
      extended by org.aksw.commons.sparql.api.cache.extra.CacheCoreH2
All Implemented Interfaces:
CacheCore, SqlDao

public class CacheCoreH2
extends SqlDaoBase
implements CacheCore

The class is used to cache information about resources to a database. Provides the connection to an H2 database in a light weight, configuration free manner. Note: Currently, either select ot construct has to be used (not both).

Author:
Jens Lehmann

Field Summary
 
Fields inherited from class org.aksw.commons.sparql.api.cache.extra.SqlDaoBase
idToQuery, queryToStmt
 
Constructor Summary
CacheCoreH2(Connection conn, long lifespan)
           
 
Method Summary
 CacheResource _lookup(String queryString)
           
 void _write(String queryString, InputStream in)
           
static CacheCoreH2 create(boolean autoServerMode, String dbDir, String dbName, long lifespan)
          Loads the driver
 CacheResource lookup(String queryString)
           
 void write(String queryString, InputStream in)
           
 
Methods inherited from class org.aksw.commons.sparql.api.cache.extra.SqlDaoBase
execute, executeList, executeQuery, getConnection, setConnection, setPreparedStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheCoreH2

public CacheCoreH2(Connection conn,
                   long lifespan)
            throws SQLException
Throws:
SQLException
Method Detail

create

public static CacheCoreH2 create(boolean autoServerMode,
                                 String dbDir,
                                 String dbName,
                                 long lifespan)
                          throws ClassNotFoundException,
                                 SQLException
Loads the driver

Throws:
ClassNotFoundException
SQLException

lookup

public CacheResource lookup(String queryString)
Specified by:
lookup in interface CacheCore

_lookup

public CacheResource _lookup(String queryString)
                      throws SQLException
Throws:
SQLException

write

public void write(String queryString,
                  InputStream in)
Specified by:
write in interface CacheCore

_write

public void _write(String queryString,
                   InputStream in)
            throws SQLException
Throws:
SQLException


Copyright © 2011. All Rights Reserved.