Package cx.fbn.nevernote.sql.driver

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


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


      logger.log(logger.MEDIUM, dbName+" guid update failed.");
      logger.log(logger.MEDIUM, query.lastError());
    }
    
    // Update any notes containing the notebook guid
    query.prepare("Update Note set notebookGuid=:newGuid where notebookGuid=:oldGuid");
    query.bindValue(":oldGuid", oldGuid);
    query.bindValue(":newGuid", newGuid);
    if (!query.exec()) {
      logger.log(logger.MEDIUM, dbName+" guid update for note failed.");
      logger.log(logger.MEDIUM, query.lastError());
View Full Code Here

      logger.log(logger.MEDIUM, query.lastError());
    }
   
    // Update any watch folders with the new guid
    query = new NSqlQuery(db.getConnection());
    query.prepare("Update WatchFolders set notebook=:newGuid where notebook=:oldGuid");
    query.bindValue(":oldGuid", oldGuid);
    query.bindValue(":newGuid", newGuid);
    if (!query.exec()) {
      logger.log(logger.MEDIUM, "Update WatchFolder notebook failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
View Full Code Here

    Notebook tempNotebook;
    boolean check;
           
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    query.prepare("Select guid, sequence, name, defaultNotebook, " +
        "serviceCreated, serviceUpdated, published, stack, "+
        "publishinguri, publishingascending, publishingPublicDescription, "+
        "publishingOrder " +
        "from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
View Full Code Here

  // does a record exist?
  private boolean exists(String guid) {
    
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select guid from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, dbName+" SQL retrieve has failed.");
    boolean retval = query.next();
    return retval;
View Full Code Here

  }
  // Reset the dirty flag.  Typically done after a sync.
  public void  resetDirtyFlag(String guid) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update "+dbName+" set isdirty='false' where guid=:guid");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error resetting "+dbName+" dirty field.");
  }
  // Set the default notebook
View Full Code Here

  }
  // Set the default notebook
  public void setDefaultNotebook(String guid) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update "+dbName+" set defaultNotebook=false, isDirty=true where linked=false and defaultNotebook=true");
    if (!query.exec())
      logger.log(logger.EXTREME, "Error removing default "+dbName+".");
    query.prepare("Update "+dbName+" set defaultNotebook=true, isDirty=true where guid=:guid and linked=false");
    query.bindValue(":guid", guid);
    if (!query.exec())
View Full Code Here

    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update "+dbName+" set defaultNotebook=false, isDirty=true where linked=false and defaultNotebook=true");
    if (!query.exec())
      logger.log(logger.EXTREME, "Error removing default "+dbName+".");
    query.prepare("Update "+dbName+" set defaultNotebook=true, isDirty=true where guid=:guid and linked=false");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error setting default "+dbName+".");
  }
 
View Full Code Here

 
  // Get the notebooks custom icon
  public QIcon getIcon(String guid) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    if (!query.prepare("Select icon from "+dbName+" where guid=:guid"))
      logger.log(logger.EXTREME, "Error preparing "+dbName+" icon select.");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error finding "+dbName+" icon.");
    if (!query.next() || query.getBlob(0) == null)
View Full Code Here

  }
  // Get the notebooks custom icon
  public QByteArray getIconAsByteArray(String guid) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    if (!query.prepare("Select icon from "+dbName+" where guid=:guid"))
      logger.log(logger.EXTREME, "Error preparing "+dbName+" icon select.");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error finding "+dbName+" icon.");
    if (!query.next() || query.getBlob(0) == null)
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.