Package cx.fbn.nevernote.sql.driver

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


 
  // Set the notebooks custom icon
  public void updateIcon(String name, String rectype, QIcon icon, String filetype) {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (icon == null) {
      if (!query.prepare("delete from SystemIcon where name=:name and type=:type"))
        logger.log(logger.EXTREME, "Error preparing notebook icon select.");
    } else {
      if (!query.prepare("update SystemIcon set icon=:icon where name=:name and type=:type"))
        logger.log(logger.EXTREME, "Error preparing notebook icon select.");
      QBuffer buffer = new QBuffer();
View Full Code Here


    NSqlQuery query = new NSqlQuery(db.getConnection());
    if (icon == null) {
      if (!query.prepare("delete from SystemIcon where name=:name and type=:type"))
        logger.log(logger.EXTREME, "Error preparing notebook icon select.");
    } else {
      if (!query.prepare("update SystemIcon set icon=:icon where name=:name and type=:type"))
        logger.log(logger.EXTREME, "Error preparing notebook icon select.");
      QBuffer buffer = new QBuffer();
          if (!buffer.open(QIODevice.OpenModeFlag.ReadWrite)) {
            logger.log(logger.EXTREME, "Failure to open buffer.  Aborting.");
            return;
View Full Code Here

  public void addNotebook(SharedNotebook tempNotebook, boolean isDirty) {
    boolean check;
   
    SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Insert Into SharedNotebook (id, userid, notebookGuid, email,  "
        +"notebookModifiable, requireLogin, serviceCreated, shareKey, username, isDirty) "  
        + " Values("
        +":id, :userid, :notebookGuid, :email, "
        +":notebookModifiable, :requireLogin, :serviceCreated, "
        +":shareKey, :username, :isDirty)");
View Full Code Here

  // Save an individual notebook
  public void addNotebook(LinkedNotebook tempNotebook,  boolean isDirty) {
    boolean check;
   
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Insert Into LinkedNotebook (guid, shareName, username,  "
        +"shardId, shareKey, uri, updateSequenceNumber, isDirty, lastSequenceNumber, "
        + "lastSequenceDate, notebookGuid) "  
        + " Values("
        +":guid, :shareName, :username, "
        +":shardId, :shareKey, :uri,:usn, :isDirty, 0, 0, :notebookGuid)");
View Full Code Here

    // Delete the notebook record
    db.getNotebookTable().expungeNotebook(notebookGuid, needsSync);
   
    // Finally, delete the linked notebook object itself
        NSqlQuery query = new NSqlQuery(db.getConnection());
         check = query.prepare("delete from LinkedNotebook "
           +"where guid=:guid");
    if (!check) {
      logger.log(logger.EXTREME, "LinkedNotebook SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
View Full Code Here

    }
  }
  // Check if a notebook exists
  public boolean exists(String id) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
         boolean check = query.prepare("Select guid from linkednotebook where guid=:guid");
         query.bindValue(":guid", id);
    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "LinkedNotebook Table exists check failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
View Full Code Here

      addNotebook(tempNotebook, isDirty);
      return;
    }
   
        NSqlQuery query = new NSqlQuery(db.getConnection());
         check = query.prepare("Update LinkedNotebook set guid=:guid, shareName=:shareName, " +
             "username=:username, shardID=:shardID, uri=:uri, updateSequenceNumber=:usn, isDirty=:isDirty "+
             "where guid=:keyGuid");
    query.bindValue(":guid", tempNotebook.getGuid());
    query.bindValue(":keyGuid", tempNotebook.getGuid());
    query.bindValue(":shareName", tempNotebook.getShareName());
View Full Code Here

    LinkedNotebook tempNotebook;
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select guid, shareName, username, shardID, shareKey, uri " +
        " from LinkedNotebook where guid=:guid");
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL retrieve notebook prepare has failed.");
    query.bindValue(":guid", guid);
    query.exec();
View Full Code Here

    LinkedNotebook tempNotebook;
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select guid, shareName, username, shardID, shareKey, uri " +
        " from LinkedNotebook where notebookguid=:guid");
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL retrieve notebook prepare has failed.");
    query.bindValue(":guid", guid);
    query.exec();
View Full Code Here

  public long getLastSequenceDate(String guid) {
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select LastSequenceDate "
        +"from LinkedNotebook where guid=:guid");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
      logger.log(logger.EXTREME, "LinkedNotebook SQL retrieve last sequence date 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.