Package cx.fbn.nevernote.sql.driver

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


    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Update "+dbName+" set wide_sort_order=:order, wide_sort_column=:column where guid=:guid");
        else
          check = query.prepare("Update "+dbName+" set narrow_sort_order=:order, narrow_sort_column=:column where guid=:guid");

    query.bindValue(":guid", guid);
    query.bindValue(":order", order);
View Full Code Here


        NSqlQuery query = new NSqlQuery(db.getConnection());
               
        if (Global.getSortOrder() != Global.View_List_Wide)
          check = query.prepare("Update "+dbName+" set wide_sort_order=:order, wide_sort_column=:column where guid=:guid");
        else
          check = query.prepare("Update "+dbName+" set narrow_sort_order=:order, narrow_sort_column=:column where guid=:guid");

    query.bindValue(":guid", guid);
    query.bindValue(":order", order);
    query.bindValue(":column", column);
    check = query.exec();
View Full Code Here

  public boolean isLinked(String guid) {
    boolean check;
   
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select guid "
        +"from "+dbName+" where guid=:guid and linked=true");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL isLinked failed.");
View Full Code Here

  public List<String> getValidLinkedTags(String guid) {
    boolean check;
    List<String> tags = new ArrayList<String>();
   
        NSqlQuery query = new NSqlQuery(db.getConnection());              
    check = query.prepare("select distinct tagGuid from noteTags " +
        "where noteGuid in " +
        "(SELECT guid from note where notebookguid=:guid)");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
View Full Code Here

  }
  // Given a notebook, what tags are valid for it?
  public void deleteLinkedTags(String guid) {
   
        NSqlQuery query = new NSqlQuery(db.getConnection());              
    query.prepare("select distinct tagguid from noteTags " +
        "where noteGuid in " +
        "(SELECT guid from note where notebookguid=:guid)");
    query.bindValue(":guid", guid);
    boolean check = query.exec();
    if (!check)
View Full Code Here

    while(query.next()) {
      db.getTagTable().expungeTag(query.valueString(0), false);
    }
   
   
    query.prepare("delete from note " +
        "where notebookguid=:guid");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL getValidLinedTags failed.");
View Full Code Here

  // Given a notebook, what tags are valid for it?
  public void convertFromSharedNotebook(String guid, boolean local) {
   
        NSqlQuery query = new NSqlQuery(db.getConnection())
       
        query.prepare("Update Notebook set sequence=0, published=false, isdirty=true, local=:local, publishinguri=''"
        +" where guid=:guid");
    query.bindValue(":guid", guid);
    if (local)
      query.bindValue(":local", true);
    else
View Full Code Here

      query.bindValue(":local", false);
   
    if (!query.exec())
      logger.log(logger.EXTREME, "NotebookTable.convertToLocalNotebook error.");
   
        query.prepare("Update Note set updatesequencenumber=0, isdirty=true"
        +" where notebookguid=:guid");
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "NotebookTable.convertToLocalNotebook #2 error.");
     
View Full Code Here

  // Add an item to the deleted table
  public void addDeletedItem(String guid, String type) {
    if (exists(guid,type))
      return;
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Insert Into DeletedItems (guid, type) Values(:guid, :type)");
    query.bindValue(":guid", guid);
    query.bindValue(":type", type);
    if (!query.exec()) {
      logger.log(logger.MEDIUM, "Insert into deleted items failed.");
      logger.log(logger.MEDIUM, query.lastError());
View Full Code Here

    }
  }
  // Check if a record exists
  public boolean exists(String guid, String type) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("Select guid, type from DeletedItems where guid=:guid and type=:type");
    query.bindValue(":guid", guid);
    query.bindValue(":type", type);
    query.exec();
    if (!query.next()) {
      return false;
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.