Package cx.fbn.nevernote.sql.driver

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


  }
  // Check if a notebook exists
  public boolean exists(long id) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
        logger.log(logger.EXTREME, "Checking if shared notebook " +id +" exists");
         boolean check = query.prepare("Select id from sharednotebook where id=:id");
         query.bindValue(":id", id);
    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "SharedNotebook Table exists check failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
View Full Code Here


  // Delete the notebook based on a id
  public void expungeNotebook(long id, boolean needsSync) {
    boolean check;
        NSqlQuery query = new NSqlQuery(db.getConnection());

         check = query.prepare("delete from SharedNotebook "
           +"where id=:id");
    if (!check) {
      logger.log(logger.EXTREME, "SharedNotebook SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
View Full Code Here

  // Delete the notebook based on a id
  public void expungeNotebookByGuid(String id, boolean needsSync) {
    boolean check;
        NSqlQuery query = new NSqlQuery(db.getConnection());

         check = query.prepare("delete from SharedNotebook "
           +"where guid=:id");
    if (!check) {
      logger.log(logger.EXTREME, "SharedNotebook SQL delete by notebook guid prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
View Full Code Here

   
    SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
   
    StringBuilder serviceCreated = new StringBuilder(simple.format(tempNotebook.getServiceCreated()));           
        NSqlQuery query = new NSqlQuery(db.getConnection());
         check = query.prepare("Update SharedNotebook set userid=:userid, notebookGuid=:notebook, "
             + "email=:email, notebookModifiable=:mod, requireLogin=:rlogin, serviceCreated=:serviceCreated, "
             + "shareKey=:shareKey, username=:username, isDirty=:isdirty where id=:id");
    query.bindValue(":id", tempNotebook.getId());
    query.bindValue(":userid", tempNotebook.getUserId());
    query.bindValue(":notebook", tempNotebook.getNotebookGuid());
View Full Code Here

    List<SharedNotebook> index = new ArrayList<SharedNotebook>();
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select id, userid, notebookGuid, email, notebookModifiable, requireLogin, " +
        "serviceCreated, "+
        "shareKey, username from SharedNotebook where notebookGuid=:notebookGuid ");
    if (!check)
      logger.log(logger.EXTREME, "SharedNotebook getForNotebook SQL prepare has failed.");
    query.bindValue(":notebookGuid", guid);
View Full Code Here

    return true;
  }
  // Add an item to the deleted table
  public void expungeDeletedItem(String guid, String type) {
        NSqlQuery query = new NSqlQuery(db.getConnection());
    query.prepare("delete from DeletedItems where guid=:guid and type=:type");
    query.bindValue(":guid", guid);
    query.bindValue(":type", type);
    if (!query.exec()) {
      logger.log(logger.LOW, "Expunge deleted items failed.");
      logger.log(logger.LOW, query.lastError());
View Full Code Here

    if (tagGuid == null)
      return null;
    List<String> notes = new ArrayList<String>();
   
    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());
View Full Code Here

  public boolean checkNoteNoteTags(String noteGuid, String tagGuid) {
    if (noteGuid == null || tagGuid == null)
      return false;
    boolean check;
    NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Select "
        +"NoteGuid, TagGuid from NoteTags where noteGuid = :noteGuid and tagGuid = :tagGuid");
    if (!check)
      logger.log(logger.EXTREME, "checkNoteTags SQL prepare has failed.");
   
    query.bindValue(":noteGuid", noteGuid);
View Full Code Here

  // Save Note Tags
  public void saveNoteTag(String noteGuid, String tagGuid, boolean isDirty) {
    boolean check;
    NSqlQuery query = new NSqlQuery(db.getConnection());

    check = query.prepare("Insert Into NoteTags (noteGuid, tagGuid) "
        +"Values("
        +":noteGuid, :tagGuid)");
    if (!check)
      logger.log(logger.EXTREME, "Note SQL insert prepare has failed.");
 
View Full Code Here

    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");
    if (!check)
      logger.log(logger.EXTREME, "RNoteTagsTable.saveNoteTag prepare has failed.");
    query.bindValue(":isDirty", isDirty);
    query.bindValue(":guid", noteGuid);
    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.