Package cx.fbn.nevernote.sql.driver

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


    boolean check;
    Notebook n;
    n = getNotebook(guid);
        NSqlQuery query = new NSqlQuery(db.getConnection());

         check = query.prepare("delete from "+dbName+" where guid=:guid");
    if (!check) {
      logger.log(logger.EXTREME, dbName+" SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
    query.bindValue(":guid", guid);
View Full Code Here


    boolean check;
   
    SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
   
        NSqlQuery query = new NSqlQuery(db.getConnection());
         check = query.prepare("Update "+dbName+" set sequence=:sequence, name=:name, defaultNotebook=:defaultNotebook, " +
             "serviceCreated=:serviceCreated, serviceUpdated=:serviceUpdated, "+
        "published=:published, isDirty=:isDirty, publishinguri=:uri, "+
        "publishingOrder=:order, " +
        "publishingAscending=:ascending, " +
        "publishingPublicDescription=:desc, " +
View Full Code Here

  }
  // Archive or un-archive a notebook
  public void setArchived(String guid, boolean val) {
    boolean check;     
        NSqlQuery query = new NSqlQuery(db.getConnection());            
    check = query.prepare("Update "+dbName+" set archived=:archived where guid=:guid");
    if (!check)
      logger.log(logger.EXTREME, dbName+" SQL archive update has failed.");
    query.bindValue(":guid", guid);
    query.bindValue(":archived", val);
    query.exec();
View Full Code Here

 
  // Check for a local/remote notebook
  public boolean isNotebookLocal(String guid) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select local from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
    query.exec();
    if (!query.next()) {
      return false;
    }
View Full Code Here

  }
  // Check for a local/remote notebook
  public boolean isNotebookLinked(String guid) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select linked from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
    query.exec();
    if (!query.next()) {
      return false;
    }
View Full Code Here

    return returnValue;
  }
  public boolean isReadOnly(String guid) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select readOnly from "+dbName+" where guid=:guid and readOnly=true");
    query.bindValue(":guid", guid);
    query.exec();
    if (!query.next()) {
      return false;
    }
View Full Code Here

  }
  // Update a notebook sequence number
  public void updateNotebookSequence(String guid, int sequence) {
    boolean check;
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Update "+dbName+" set sequence=:sequence where guid=:guid");
    query.bindValue(":guid", guid);
    query.bindValue(":sequence", sequence);
    query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, dbName+" sequence update failed.");
View Full Code Here

    SavedSearch tempSearch = null;
    boolean check;
     
        NSqlQuery query = new NSqlQuery(db.getConnection());
                       
    check = query.prepare("Select guid, name, query, format, sequence"
        +" from SavedSearch where guid=:guid");
    if (!check)
      logger.log(logger.EXTREME, "SavedSearch SQL prepare has failed in getSavedSearch.");
    query.bindValue(":guid", guid);
    query.exec();
View Full Code Here

  }
  // Update a tag
  public void updateSavedSearch(SavedSearch search, boolean isDirty) {
    boolean check;
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Update SavedSearch set sequence=:sequence, "+
      "name=:name, isDirty=:isDirty, query=:query, format=:format "
      +"where guid=:guid");
      
    if (!check) {
      logger.log(logger.EXTREME, "SavedSearch SQL update prepare has failed.");
View Full Code Here

  public void expungeSavedSearch(String guid, boolean needsSync) {
    boolean check;
    SavedSearch s = getSavedSearch(guid);
        NSqlQuery query = new NSqlQuery(db.getConnection());

         check = query.prepare("delete from SavedSearch "
           +"where guid=:guid");
    if (!check) {
      logger.log(logger.EXTREME, "SavedSearch SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
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.