Package org.tmatesoft.sqljet.core.table

Examples of org.tmatesoft.sqljet.core.table.SqlJetDb.beginTransaction()


        }

        System.out.println();
        System.out.println(">After insertion of a new record and updating dates (by PK):");
        System.out.println();
        db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
        try {
            printRecords(table.order(table.getPrimaryKeyIndexName()));
            System.out.println();
            System.out.println(">Same in order defined by " + FULL_NAME_INDEX + " :");
            System.out.println();
View Full Code Here


        }
      
        System.out.println();
        System.out.println(">Dropping tables and indices:");
        System.out.println();
        db.beginTransaction(SqlJetTransactionMode.WRITE);
        try {
            Set<String> tables = db.getSchema().getTableNames();
            for (String tableName : tables) {
                ISqlJetTableDef tableDef = db.getSchema().getTable(tableName);
                Set<ISqlJetIndexDef> tableIndices = db.getSchema().getIndexes(tableDef.getName());
View Full Code Here

        public Object run(SqlJetDb db) throws SqlJetException {
          db.getOptions().setUserVersion(1);
          return true;
        }
      }, SqlJetTransactionMode.WRITE);
      db.beginTransaction(SqlJetTransactionMode.WRITE);
      String sql1 = "CREATE TABLE IF NOT EXISTS TESTXX (a int, b int, c int, "
          + "d int, blob blob, PRIMARY KEY (a,b,c,d))";
      String sql2 = "CREATE INDEX IF NOT EXISTS IND on TESTXX (a,b,c,d)";
      db.createTable(sql1);
      db.createIndex(sql2);
View Full Code Here

      connect2.beginTransaction(SqlJetTransactionMode.WRITE);
      connect2.getTable("t").insert("t");
      try {
        connect2.commit();
      } catch (SqlJetException e) {
        connect3.beginTransaction(SqlJetTransactionMode.READ_ONLY);
      } finally {
        try {
          connect1.rollback();
          connect2.rollback();
          connect3.rollback();
View Full Code Here

   
    lock.lock();
   
    try
    {
      database.beginTransaction(SqlJetTransactionMode.WRITE);
     
      try
      {
        transaction.execute(database);
       
View Full Code Here

   
    lock.lock();
   
    try
    {
      database.beginTransaction(SqlJetTransactionMode.READ_ONLY);
     
      try
      {
        return query.execute(database);
      }
View Full Code Here

     
      addColumnToTable(podsalinanDB,"podcasts","auto_queue","INTEGER");
     
      try {
        table = podsalinanDB.getTable("downloads");
        podsalinanDB.beginTransaction(SqlJetTransactionMode.READ_ONLY);
        if (table!=null){
          ISqlJetCursor currentDBLine = table.order(table.getPrimaryKeyIndexName());
          if (!currentDBLine.eof()){
            do {
              URLDownload newDownload = new URLDownload(currentDBLine.getString("url"),
View Full Code Here

        }
      }
       
      try {
        table = podsalinanDB.getTable("settings");
        podsalinanDB.beginTransaction(SqlJetTransactionMode.READ_ONLY);
       
        if (table!=null){
          ISqlJetCursor currentDBLine = table.order(table.getPrimaryKeyIndexName());
          if (!currentDBLine.eof()){
            do {
View Full Code Here

        }
      }

      try {
        table = podsalinanDB.getTable("podcasts");
        podsalinanDB.beginTransaction(SqlJetTransactionMode.READ_ONLY);
        if (table!=null){
          ISqlJetCursor currentDBLine = table.order(table.getPrimaryKeyIndexName());
          if (!currentDBLine.eof()){
            do {
              Podcast newPodcast = new Podcast(currentDBLine.getString("name"),
View Full Code Here

               ProgSettings settings) {
   
    File podsalinanDBFile = new File(settingsDir.concat("/podsalinan.db"));
    boolean dataFileExists = podsalinanDBFile.exists();
    SqlJetDb db = new SqlJetDb(podsalinanDBFile,true);
    db.beginTransaction(SqlJetTransactionMode.WRITE);
    if (!dataFileExists){
      try {
        db.createTable(CREATE_DOWNLOADS);
      } catch (SqlJetException e) {
        debugOutput.printStackTrace(e.getStackTrace());
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.