Package cx.fbn.nevernote.sql.driver

Examples of cx.fbn.nevernote.sql.driver.NSqlQuery.exec()


        NSqlQuery query = new NSqlQuery(resourceConn);
        String linkcmd = "create linked table oldnoteresources "+
            "('org.h2.Driver', '"+url+"', '"+userid+"', '"+passwordString+"', 'NoteResources')";
        query.exec(linkcmd);
        query.exec("insert into noteresources (select * from oldnoteresources)");
        query.exec("Drop table oldnoteresources;");
        query.exec("Update noteresources set indexneeded='true'");
       
      }
    }
    if (!indexDbExists)  {
View Full Code Here


        String linkcmd = "create linked table oldnoteresources "+
            "('org.h2.Driver', '"+url+"', '"+userid+"', '"+passwordString+"', 'NoteResources')";
        query.exec(linkcmd);
        query.exec("insert into noteresources (select * from oldnoteresources)");
        query.exec("Drop table oldnoteresources;");
        query.exec("Update noteresources set indexneeded='true'");
       
      }
    }
    if (!indexDbExists)  {
      createIndexTables();
View Full Code Here

    }
  }
 
  public void executeSql(String sql) {
    NSqlQuery query = new NSqlQuery(conn);
    query.exec(sql)
  }
 
  public void checkDatabaseVersion() {
    if (!Global.getDatabaseVersion().equals("0.86")) {
      upgradeDb(Global.getDatabaseVersion());
View Full Code Here

  //* Begin/End transactions
  //****************************************************************
  public void beginTransaction() {
    commitTransaction();
        NSqlQuery query = new NSqlQuery(getConnection());                         
    if (!query.exec("Begin Transaction"))
      logger.log(logger.EXTREME, "Begin transaction has failed: " +query.lastError());

  }
  public void commitTransaction() {
        NSqlQuery query = new NSqlQuery(getConnection());
View Full Code Here

  }
  public void commitTransaction() {
        NSqlQuery query = new NSqlQuery(getConnection());
                         
    if (!query.exec("Commit"))
      logger.log(logger.EXTREME, "Transaction commit has failed: " +query.lastError());
  }

  //****************************************************************
  //* Check if a table exists
View Full Code Here

  // Create the table
  public void createTable(boolean addDefaulte) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
        logger.log(logger.HIGH, "Creating table "+dbName+"...");
        if (!query.exec("Create table "+dbName+" (guid varchar primary key, " +
            "sequence integer, " +
            "name varchar, "+
            "defaultNotebook varchar, "+
            "serviceCreated timestamp, " +
            "serviceUpdated timestamp, "+
View Full Code Here

   
    query.bindValue(":isDirty", true);
    query.bindValue(":autoEncrypt", false);
    query.bindValue(":local", false);

    boolean check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "Initial "+dbName+" Table insert failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
    }
View Full Code Here

    
  }
  // Drop the table
  public void dropTable() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.exec("Drop table "+dbName);
  }
  // Save an individual notebook
  public void addNotebook(Notebook tempNotebook, boolean isDirty, boolean local) {
    addNotebook(tempNotebook, isDirty, local, false, false);
  }
View Full Code Here

      query.bindValue(":isDirty", false);
    query.bindValue(":autoEncrypt", false);
    query.bindValue(":local", local);
    query.bindValue(":stack", tempNotebook.getStack());

    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, ""+dbName+" Table insert failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
    }
  }
View Full Code Here

    if (!check) {
      logger.log(logger.EXTREME, dbName+" SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
      logger.log(logger.MEDIUM, dbName+" delete failed.");
   
    // Signal the parent that work needs to be done
    if  (needsSync && n!=null && n.getUpdateSequenceNum() > 0) {
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.