Package cx.fbn.nevernote.sql.driver

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


      addSavedSearch(search, isDirty);
  }
  public void  resetDirtyFlag(String guid) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update SavedSearch set isdirty=false where guid=:guid");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error resetting SavedSearch dirty field in resetDirtyFlag().");
  }
View Full Code Here


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

  }
  // Set the custom icon
  public void setIcon(String guid, QIcon icon, String type) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (icon == null) {
      if (!query.prepare("update SavedSearch set icon=null where guid=:guid"))
        logger.log(logger.EXTREME, "Error preparing saved search icon set.");
    } else {
      if (!query.prepare("update SavedSearch set icon=:icon where guid=:guid"))
        logger.log(logger.EXTREME, "Error preparing tag icon set.");
      QBuffer buffer = new QBuffer();
View Full Code Here

    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (icon == null) {
      if (!query.prepare("update SavedSearch set icon=null where guid=:guid"))
        logger.log(logger.EXTREME, "Error preparing saved search icon set.");
    } else {
      if (!query.prepare("update SavedSearch set icon=:icon where guid=:guid"))
        logger.log(logger.EXTREME, "Error preparing tag icon set.");
      QBuffer buffer = new QBuffer();
          if (!buffer.open(QIODevice.OpenModeFlag.ReadWrite)) {
            logger.log(logger.EXTREME, "Failure to open buffer.  Aborting.");
            return;
View Full Code Here

  }
  // Get notebooks/tags to ignore
  public List<String> getIgnoreRecords(String type) {
    List<String> values = new ArrayList<String>();
        NSqlQuery query = new NSqlQuery(db.getConnection());
        if (!query.prepare("Select value from Sync where key like :type")) {
      logger.log(logger.MEDIUM, "getIgnoreRecords from sync failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
        query.bindValue(":type", "IGNORE" +type +"-%");
View Full Code Here

  // Add an folder
  public void addWatchFolder(String folder, String notebook, boolean keep, int depth) {
    if (exists(folder))
      expungeWatchFolder(folder);
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Insert Into WatchFolders (folder, notebook, keep, depth) " +
        "values (:folder, :notebook, :keep, :depth)");
    query.bindValue(":folder", folder);
    query.bindValue(":notebook", notebook);
    query.bindValue(":keep", keep);
    query.bindValue(":depth", depth);
View Full Code Here

    }
  }
  // Add an folder
  public boolean exists(String folder) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Select folder from WatchFolders where folder=:folder ");
    query.bindValue(":folder", folder);
    query.exec();
    if (!query.next())
      return false;
    else
View Full Code Here

  }

  // remove an folder
  public void expungeWatchFolder(String folder) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("delete from WatchFolders where folder=:folder");
    query.bindValue(":folder", folder);
    if (!query.exec()) {
      logger.log(logger.MEDIUM, "Expunge WatchFolder failed.");
      logger.log(logger.MEDIUM, query.lastError());
    }
View Full Code Here

  }
 
  public String getNotebook(String dir) {
    logger.log(logger.HIGH, "Entering RWatchFolders.getNotebook");
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Select notebook from WatchFolders where folder=:dir");
    query.bindValue(":dir", dir);
    query.exec();
    String response = null;
    while (query.next()) {
      response = query.valueString(0);
View Full Code Here

  // Update a tag
  public void updateTag(Tag tempTag, boolean isDirty, String realName) {
    boolean check;
   
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Update Tag set parentGuid=:parentGuid, sequence=:sequence, "+
      "hashCode=:hashCode, name=:name, isDirty=:isDirty "
      +"where guid=:guid");
     
    if (!check) {
      logger.log(logger.EXTREME, "Tag SQL update prepare has failed.");
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.