Package cx.fbn.nevernote.sql.driver

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


  }
  // Save a tag
  public void addSavedSearch(SavedSearch search, boolean isDirty) {
    boolean check;
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Insert Into SavedSearch (guid, query, sequence, format, name, isDirty)"
        +" Values(:guid, :query, :sequence, :format, :name, :isDirty)");
    if (!check) {
      logger.log(logger.EXTREME, "Search SQL insert prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
View Full Code Here


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

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

  }
  // Get/Set stacks
  public boolean stackExists(String stack) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select guid from "+dbName+" where stack=:stack limit 1");
    query.bindValue(":stack", stack);
    if (!query.exec())
      logger.log(logger.EXTREME, "Error setting "+dbName+" stack.");
    if (query.next())
      return true;
View Full Code Here

  // Set Publishing
  public void setPublishing(String guid, boolean published, Publishing p) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
   
    query.prepare("Update "+dbName+" set publishingPublicDescription=:publishingPublicDescription, " +
        "publishingUri=:publishingUri, publishingOrder=:publishingOrder, published=:published, "+
        "publishingAscending=:publishingAscending, isdirty=true where "+
        "guid=:guid");
    query.bindValue(":publishingPublicDescription", p.getPublicDescription());
    query.bindValue(":publishingUri", p.getUri());
View Full Code Here

  public String getNotebookByUri(String uri) {
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select guid "
        +"from "+dbName+" where publishingUri=:uri");
    query.bindValue(":uri", uri);
    check = query.exec();
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL retrieve guid by uri has failed.");
View Full Code Here

    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Select wide_sort_column "
        +"from "+dbName+" where guid=:guid");
        else
          check = query.prepare("Select narrow_sort_column "
      +"from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
View Full Code Here

               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Select wide_sort_column "
        +"from "+dbName+" where guid=:guid");
        else
          check = query.prepare("Select narrow_sort_column "
      +"from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check) {
      logger.log(logger.EXTREME, "Notebook SQL retrieve sort order has failed.");
View Full Code Here

    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Select wide_sort_order "
        +"from "+dbName+" where guid=:guid");
        else
          check = query.prepare("Select narrow_sort_order "
      +"from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
View Full Code Here

               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Select wide_sort_order "
        +"from "+dbName+" where guid=:guid");
        else
          check = query.prepare("Select narrow_sort_order "
      +"from "+dbName+" where guid=:guid");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check) {
      logger.log(logger.EXTREME, "Notebook SQL retrieve sort order 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.