Package com.caucho.db

Examples of com.caucho.db.Database


  @Override
  public java.sql.ResultSet executeQuery(String sql)
    throws SQLException
  {
    Database db = getDatabase();
   
    if (db == null)
      throw new SQLException(L.l("statement is closed"));

    Query query = db.parseQuery(sql);
   
    java.sql.ResultSet rs = executeQuery(query, getQueryContext());

    return rs;
  }
View Full Code Here


  /**
   * Creates a new data source
   */
  public DataSourceImpl()
  {
    _database = new Database();
  }
View Full Code Here

  /**
   * Creates a new data source
   */
  public ConnectionPoolDataSourceImpl()
  {
    _database = new Database();
  }
View Full Code Here

  @Override
  public boolean execute()
    throws SQLException
  {
    Database db = getDatabase();
   
    if (db == null)
      throw new SQLException(L.l("statement is closed"));

    setResultSet(executeQuery(getQuery(), getQueryContext()));
View Full Code Here

   * Creates an independent store.
   */
  public static BlockStore create(Path path, boolean isMmap)
  throws IOException, SQLException
  {
    Database db = new Database();
    db.init();

    BlockStore store = new BlockStore(db, "temp", null, path, isMmap);

    if (path.canRead())
      store.init();
View Full Code Here

  }

  public static BTree createTest(Path path, int keySize)
    throws IOException, java.sql.SQLException
  {
    Database db = new Database();
    db.setPath(path);
    db.init();

    BlockStore store = new BlockStore(db, "test", null);
    store.create();

    Block block = store.allocateIndexBlock();
View Full Code Here

  Database _db;
 
  public DebugQuery(Path path)
    throws Exception
  {
    _db = new Database();
    _db.setPath(path);
    _db.init();
  }
View Full Code Here

      if (storePath.exists()) {
        log.warning(L.l("Removal of old temp file '{0}' failed. Please check permissions.",
                        storePath.getNativePath()));
      }
     
      Database database = new Database();
      database.ensureMemoryCapacity(1024 * 1024);
      database.init();

      _store = new BlockStore(database, name, null, storePath);
      _store.setFlushDirtyBlocksOnCommit(false);
      _store.create();
    } catch (Exception e) {
View Full Code Here

   * Creates an independent store.
   */
  public static BlockStore create(Path path)
    throws IOException, SQLException
  {
    Database db = new Database();
    db.init();

    BlockStore store = new BlockStore(db, "temp", null, path);

    if (path.canRead())
      store.init();
View Full Code Here

  }

  public static BTree createTest(Path path, int keySize)
    throws IOException, java.sql.SQLException
  {
    Database db = new Database();
    db.setPath(path);
    db.init();

    BlockStore store = new BlockStore(db, "test", null);
    store.create();

    Block block = store.allocateIndexBlock();
View Full Code Here

TOP

Related Classes of com.caucho.db.Database

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.