Package cx.fbn.nevernote.sql.driver

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


    check = query.prepare("Select "
        +"recognitionHash, recognitionSize, recognitionBinary, noteGuid "
        +" from NoteResources where guid=:guid");
    if (!check) {
      logger.log(logger.EXTREME, "NoteTable.getNoteRecognition SQL prepare has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    query.bindValue(":guid", guid);
    query.exec();
    if (!check) {
View Full Code Here


    }
    query.bindValue(":guid", guid);
    query.exec();
    if (!check) {
      logger.log(logger.EXTREME, "NoteTable.getNoteRecognition exec has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    Resource r = null;
    while (query.next()) {
                 
View Full Code Here

    NSqlQuery query = new NSqlQuery(db.getResourceConnection());
   
    query.prepare("Update noteresources set isdirty=false where guid=:guid");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error resetting noteresource dirty field. " +query.lastError());
    else
      query.exec("commit");
  }
  // Set if the resource should be indexed
  public void  setIndexNeeded(String guid, Boolean indexNeeded) {
View Full Code Here

    NSqlQuery query = new NSqlQuery(db.getResourceConnection());   
    query.prepare("Update noteresources set indexNeeded=:needed where guid=:guid");
    query.bindValue(":needed", indexNeeded);
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error setting noteresource indexneeded field: " +query.lastError());
    else
      query.exec("commit");
  }
  // get any unindexed resource
  public List<String> getNextUnindexed(int limit) {
View Full Code Here

  public List<String> getNextUnindexed(int limit) {
    List<String> guids = new ArrayList<String>();
        NSqlQuery query = new NSqlQuery(db.getResourceConnection());
               
    if (!query.exec("Select guid from NoteResources where indexNeeded = true limit " +limit))
      logger.log(logger.EXTREME, "NoteResources SQL retrieve has failed on getNextUnindexed(): " +query.lastError());

    // Get a list of the notes
    String guid;
    while (query.next()) {
      guid = new String();
View Full Code Here

  public List<String> getUnindexed() {
    List<String> guids = new ArrayList<String>();
        NSqlQuery query = new NSqlQuery(db.getResourceConnection());
               
    if (!query.exec("Select guid from NoteResources where indexNeeded = true"))
      logger.log(logger.EXTREME, "NoteResources SQL retrieve has failed on getUnindexed(): " +query.lastError());

    // Get a list of the notes
    String guid;
    while (query.next()) {
      guid = new String();
View Full Code Here

    List<String> guids = new ArrayList<String>();
    NSqlQuery query = new NSqlQuery(db.getResourceConnection());
   
    query.prepare("Select guid from noteresources;");
    if (!query.exec())
      logger.log(logger.EXTREME, "Error getting all note resource guids. " +query.lastError());
   
    while (query.next()) {
      guids.add(query.valueString(0));
    }
    return guids;
View Full Code Here

    List<String> guids = new ArrayList<String>();
    NSqlQuery query = new NSqlQuery(db.getResourceConnection());
   
    query.prepare("Select guid from noteresources where mime='application/vnd.evernote.ink'");
    if (!query.exec())
      logger.log(logger.EXTREME, "Error searching for ink notes. " +query.lastError());
   
    while (query.next()) {
      guids.add(query.valueString(0));
    }
    return guids;
View Full Code Here

      query.bindValue(":isDirty", isDirty);
           
      check = query.exec();
      if (!check) {
        logger.log(logger.MEDIUM, "*** NoteResource Table insert failed.");   
        logger.log(logger.MEDIUM, query.lastError());
      } else
        query.exec("commit");
     
           
      logger.log(logger.HIGH, "Leaving DBRunner.saveNoteResources");
View Full Code Here

          "where noteGuid=:noteGuid and dataHash=:hash");
    if (check)
      logger.log(logger.EXTREME, "NoteResource SQL select prepare was successful.");
    else {
       logger.log(logger.EXTREME, "NoteResource SQL select prepare has failed.");
      logger.log(logger.MEDIUM, query.lastError());
    }
    query.bindValue(":noteGuid", noteGuid);
    query.bindValue(":hash", hash);
 
    check = query.exec();
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.