Package cx.fbn.nevernote.sql.driver

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


    return list;

  }
  public void expungeAllDeletedRecords() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.exec("delete from DeletedItems");
  }

}
View Full Code Here


  // Create the table
  public void createTable() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
        // Create the NoteTag table
        logger.log(logger.HIGH, "Creating table NoteTags...");
        if (!query.exec("Create table NoteTags (noteGuid varchar, " +
            "tagGuid varchar, primary key(noteGuid, tagGuid))"))
          logger.log(logger.HIGH, "Table NoteTags creation FAILED!!!");
  }
  // Drop the table
  public void dropTable() {
View Full Code Here

          logger.log(logger.HIGH, "Table NoteTags creation FAILED!!!");
  }
  // Drop the table
  public void dropTable() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.exec("drop table NoteTags");
  }
  // Get a note tags by the note's Guid
  public List<String> getNoteTags(String noteGuid) {
    if (noteGuid == null)
      return null;
View Full Code Here

   
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Select NoteGuid from NoteTags where tagGuid = :guid");
   
    query.bindValue(":guid", tagGuid);
    if (!query.exec()) {
      logger.log(logger.EXTREME, "getTagNotes SQL select has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return notes;
    }
    while (query.next()) {
View Full Code Here

  // Get a note tags by the note's Guid
  public List<NoteTagsRecord> getAllNoteTags() {
    List<NoteTagsRecord> tags = new ArrayList<NoteTagsRecord>();
   
    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (!query.exec("Select TagGuid, NoteGuid from NoteTags")) {
      logger.log(logger.EXTREME, "NoteTags SQL select has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    while (query.next()) {
View Full Code Here

    if (!check)
      logger.log(logger.EXTREME, "checkNoteTags SQL prepare has failed.");
   
    query.bindValue(":noteGuid", noteGuid);
    query.bindValue(":tagGuid", tagGuid);
    query.exec();
   
    if (!check) {
      logger.log(logger.EXTREME, "checkNoteTags SQL select has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return false;
View Full Code Here

      logger.log(logger.EXTREME, "Note SQL insert prepare has failed.");
 
    query.bindValue(":noteGuid", noteGuid);
    query.bindValue(":tagGuid", tagGuid);
           
    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "NoteTags Table insert failed.");   
      logger.log(logger.MEDIUM, query.lastError());
    }
    check = query.prepare("Update Note set isDirty=:isDirty where guid=:guid");
View Full Code Here

    check = query.prepare("Update Note set isDirty=:isDirty where guid=:guid");
    if (!check)
      logger.log(logger.EXTREME, "RNoteTagsTable.saveNoteTag prepare has failed.");
    query.bindValue(":isDirty", isDirty);
    query.bindValue(":guid", noteGuid);
    query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "RNoteTagsTable.saveNoteTag has failed to set note as dirty.");   
      logger.log(logger.MEDIUM, query.lastError());
    }
  }
View Full Code Here

    check = query.prepare("Delete from NoteTags where noteGuid = :noteGuid");
    if (!check)
      logger.log(logger.EXTREME, "Note SQL delete prepare has failed.");
 
    query.bindValue(":noteGuid", noteGuid);
    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "NoteTags Table delete failed.");   
      logger.log(logger.MEDIUM, query.lastError());
    }
View Full Code Here

  }
  // Get a note tag counts
  public List<Pair<String,Integer>> getTagCounts() {
    List<Pair<String,Integer>> counts = new ArrayList<Pair<String,Integer>>();   
    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (!query.exec("select tagguid, count(noteguid) from notetags group by tagguid;")) {
      logger.log(logger.EXTREME, "NoteTags SQL getTagCounts has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    while (query.next()) {
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.