Codota Logo
SqlJetDb.open
Code IndexAdd Codota to your IDE (free)

How to use
open
method
in
org.tmatesoft.sqljet.core.table.SqlJetDb

Best Java code snippets using org.tmatesoft.sqljet.core.table.SqlJetDb.open (Showing top 14 results out of 315)

  • Common ways to obtain SqlJetDb
private void myMethod () {
SqlJetDb s =
  • Codota IconFile file;SqlJetDb.open(file, true)
  • Codota IconFSFS fSFS;SqlJetDb.open(fSFS.getRepositoryCacheFile(), true)
  • Smart code suggestions by Codota
}
origin: org.tmatesoft.sqljet/sqljet

protected SqlJetConnection(String fileName) throws SqlJetException {
  db = SqlJetDb.open(new File(fileName), false);
}
origin: org.tmatesoft.sqljet/sqljet

/**
 * @param file
 * @param write
 * @param fsName
 * @return SqlJetDb object for opened database
 * @throws SqlJetException
 */
public static SqlJetDb open(File file, boolean write, final String fsName) throws SqlJetException {
  final SqlJetDb db = new SqlJetDb(file, write, fsName);
  db.open();
  return db;
}
origin: org.tmatesoft.sqljet/sqljet

/**
 * @param file
 * @param write
 * @param fs
 * @return SqlJetDb object for opened database
 * @throws SqlJetException
 */
public static SqlJetDb open(File file, boolean write, final ISqlJetFileSystem fs) throws SqlJetException {
  final SqlJetDb db = new SqlJetDb(file, write, fs);
  db.open();
  return db;
}
origin: org.tmatesoft.sqljet/sqljet

public Object runWithLock(SqlJetDb db) throws SqlJetException {
  if (temporaryDb == null || !temporaryDb.isOpen()) {
    closeTemporaryDatabase();
    final File tmpDbFile = getTemporaryDatabaseFile(inMemory);
    if (tmpDbFile != null) {
      temporaryDb = SqlJetDb.open(tmpDbFile, true);
    }
  }
  return temporaryDb;
}
origin: org.syncloud/syncloud-dao-sqljet

public SqlJetDb open() {
  try {
    File dbFile = new File(dbPath);
    boolean noStructure = !dbFile.exists();
    SqlJetDb db = SqlJetDb.open(dbFile, true);
    if (noStructure) {
      createStructure(db);
    }
    return db;
  } catch (Exception exception) {
  }
  return null;
}
origin: org.tmatesoft.sqljet/sqljet

/**
 * <p>
 * Opens connection to data base. It does not create any locking on
 * database. First lock will be created when be called any method which
 * requires real access to options or schema.
 * <p>
 * 
 * <p>
 * File could be null or have special value {@link #IN_MEMORY}. If file is
 * null then will be created temporary file which will be deleted at close.
 * If file is {@link #IN_MEMORY} then file doesn't created and instead
 * database will placed in memory. If regular file is specified but doesn't
 * exist then it will be tried to created.
 * </p>
 * 
 * @param file
 *            path to data base. Could be null or {@link #IN_MEMORY}.
 * @param write
 *            open for writing if true.
 * @throws SqlJetException
 *             if any trouble with access to file or database format.
 */
public static SqlJetDb open(File file, boolean write) throws SqlJetException {
  final SqlJetDb db = new SqlJetDb(file, write);
  db.open();
  return db;
}
origin: ha-jdbc/ha-jdbc

/**
 * {@inheritDoc}
 * @see net.sf.hajdbc.pool.PoolProvider#create()
 */
@Override
public synchronized SqlJetDb create() throws SqlJetException
{
  boolean exists = this.file.exists();
  SqlJetDb db = SqlJetDb.open(this.file, true);
  if (!exists)
  {
    db.getOptions().setAutovacuum(true);
    db.getOptions().setIncrementalVacuum(true);
  }
  return db;
}
origin: org.jvnet.hudson.svnkit/svnkit

public static FSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException {
  final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager();
  try {
    cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true);
    checkFormat(cacheObj.myRepCacheDB);
    cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE);
  } catch (SqlJetException e) {
    SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
  }
  return cacheObj;
}

origin: com.svnkit/com.springsource.org.tigris.subversion.javahl

public static FSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException {
  final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager();
  try {
    cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true);
    checkFormat(cacheObj.myRepCacheDB);
    cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE);
  } catch (SqlJetException e) {
    SVNErrorManager.error(convertError(e), SVNLogType.FSFS);
  }
  return cacheObj;
}

origin: org.tmatesoft.svnkit/svnkit

public static void createRepresentationCache(File path) throws SVNException {
  SqlJetDb db = null;
  try {
    db = SqlJetDb.open(path, true);
    checkFormat(db);
  } catch (SqlJetException e) {
    SVNDebugLog.getDefaultLog().logError(SVNLogType.FSFS, e);
  } finally {
    if (db != null) {
      try {
        db.close();
      } catch (SqlJetException e) {
        SVNDebugLog.getDefaultLog().logFine(SVNLogType.FSFS, e);
      }
    }
  }
}
origin: org.jvnet.hudson.svnkit/svnkit

public static void createRepresentationCache(File path) throws SVNException {
  SqlJetDb db = null;
  try {
    db = SqlJetDb.open(path, true);
    checkFormat(db);
  } catch (SqlJetException e) {
    SVNErrorManager.error(FSRepresentationCacheManager.convertError(e), SVNLogType.FSFS);
  } finally {
    if (db != null) {
      try {
        db.close();
      } catch (SqlJetException e) {
        SVNDebugLog.getDefaultLog().logFine(SVNLogType.FSFS, e);
      }
    }
  }
}
origin: com.svnkit/com.springsource.org.tigris.subversion.javahl

public static void createRepresentationCache(File path) throws SVNException {
  SqlJetDb db = null;
  try {
    db = SqlJetDb.open(path, true);
    checkFormat(db);
  } catch (SqlJetException e) {
    SVNErrorManager.error(FSRepresentationCacheManager.convertError(e), SVNLogType.FSFS);
  } finally {
    if (db != null) {
      try {
        db.close();
      } catch (SqlJetException e) {
        SVNDebugLog.getDefaultLog().logFine(SVNLogType.FSFS, e);
      }
    }
  }
}
origin: org.tmatesoft.svnkit/svnkit

public static IFSRepresentationCacheManager openRepresentationCache(FSFS fsfs) throws SVNException {
  final FSRepresentationCacheManager cacheObj = new FSRepresentationCacheManager();
  try {
    cacheObj.myRepCacheDB = SqlJetDb.open(fsfs.getRepositoryCacheFile(), true);
    cacheObj.myRepCacheDB.setSafetyLevel(SqlJetSafetyLevel.OFF);
    
    checkFormat(cacheObj.myRepCacheDB);
    cacheObj.myTable = cacheObj.myRepCacheDB.getTable(REP_CACHE_TABLE);
  } catch (SqlJetException e) {
    SVNDebugLog.getDefaultLog().logError(SVNLogType.FSFS, e);
    return new FSEmptyRepresentationCacheManager();
    
  }
  return cacheObj;
}

origin: org.tmatesoft.svnkit/svnkit

public static SVNSqlJetDb open(File sdbAbsPath, Mode mode, SqlJetPagerJournalMode journalMode, boolean temporaryDbInMemory) throws SVNException {
  if (mode != Mode.RWCreate) {
    if (!sdbAbsPath.exists()) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "File not found ''{0}''", sdbAbsPath);
      SVNErrorManager.error(err, SVNLogType.WC);
    }
  }
  if (journalMode == null) {
    journalMode = getJournalMode();
  }
  try {
    SqlJetDb db = SqlJetDb.open(sdbAbsPath, mode != Mode.ReadOnly);
    db.setBusyHandler(DEFAULT_BUSY_HANDLER);
    db.setSafetyLevel(SqlJetSafetyLevel.OFF);
    db.setJournalMode(journalMode);
    return new SVNSqlJetDb(db, temporaryDbInMemory);
  } catch (SqlJetException e) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.SQLITE_ERROR, e);
    SVNErrorManager.error(err, SVNLogType.WC);
    return null;
  }
}
org.tmatesoft.sqljet.core.tableSqlJetDbopen

Javadoc

Opens connection to data base. It does not create any locking on database. First lock will be created when be called any method which requires real access to options or schema.

File could be null or have special value #IN_MEMORY. If file is null then will be created temporary file which will be deleted at close. If file is #IN_MEMORY then file doesn't created and instead database will placed in memory. If regular file is specified but doesn't exist then it will be tried to created.

Popular methods of SqlJetDb

  • getTable
    Open table.
  • close
  • getOptions
  • createIndex
    Create index from SQL clause.
  • createTable
    Create table from SQL clause.
  • runWithLock
    Do some actions with locking database's internal threads synchronization mutex. It is related only w
  • runWriteTransaction
    Run modifications in write transaction.
  • beginTransaction
  • commit
  • getSchema
    Get database schema.
  • runReadTransaction
    Run read-only transaction.
  • dropIndex
    Drop index.
  • runReadTransaction,
  • dropIndex,
  • dropTable,
  • getTemporaryDatabase,
  • isInTransaction,
  • isOpen,
  • rollback,
  • <init>,
  • alterTable

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • runOnUiThread (Activity)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now