Package cx.fbn.nevernote.sql.driver

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


  }
  // Create the table
  public void createTable() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
        logger.log(logger.HIGH, "Creating table LinkedNotebook...");
        if (!query.exec("Create table LinkedNotebook (guid VarChar primary key, " +
            "shareName VarChar, " +
            "username VarChar, "+
            "shardID VarChar, " +
            "shareKey VarChar, " +
            "uri VarChar, " +
View Full Code Here


          logger.log(logger.HIGH, "Table LinkedNotebook creation FAILED!!!");  
  }
  // Drop the table
  public void dropTable() {
    NSqlQuery query = new NSqlQuery(db.getConnection());
    query.exec("Drop table LinkedNotebook");
  }
  // Save an individual notebook
  public void addNotebook(LinkedNotebook tempNotebook,  boolean isDirty) {
    boolean check;
   
View Full Code Here

    if (isDirty)
      query.bindValue(":isDirty", true);
    else
      query.bindValue(":isDirty", false);

    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "LinkedNotebook Table insert failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
      return;
    }
View Full Code Here

    if (!check) {
      logger.log(logger.EXTREME, "LinkedNotebook SQL delete prepare has failed.");
      logger.log(logger.EXTREME, query.lastError().toString());
    }
    query.bindValue(":guid", id);
    check = query.exec();
    if (!check)
      logger.log(logger.MEDIUM, "LinkedNotebook delete failed.");
   
    if  (needsSync) {
      DeletedTable deletedTable = new DeletedTable(logger, db);
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());
    }
    if (query.next())
View Full Code Here

    query.bindValue(":uri", tempNotebook.getUri());
    query.bindValue(":usn", tempNotebook.getUpdateSequenceNum());

    query.bindValue(":isDirty", isDirty);
   
    check = query.exec();
    if (!check) {
      logger.log(logger.MEDIUM, "LinkedNotebook Table update failed.");
      logger.log(logger.MEDIUM, query.lastError().toString());
    }
  }
View Full Code Here

    List<LinkedNotebook> index = new ArrayList<LinkedNotebook>();
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.exec("Select guid, shareName, username, shardID, shareKey, uri " +
        " from LinkedNotebook");
    if (!check)
      logger.log(logger.EXTREME, "Notebook SQL retrieve has failed.");
    while (query.next()) {
      tempNotebook = new LinkedNotebook();
View Full Code Here

    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();
    while (query.next()) {
      tempNotebook = new LinkedNotebook();
      tempNotebook.setGuid(query.valueString(0));
      tempNotebook.setShareName(query.valueString(1));
      tempNotebook.setUsername(query.valueString(2));
View Full Code Here

    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();
    while (query.next()) {
      tempNotebook = new LinkedNotebook();
      tempNotebook.setGuid(query.valueString(0));
      tempNotebook.setShareName(query.valueString(1));
      tempNotebook.setUsername(query.valueString(2));
View Full Code Here

        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.");
    if (query.next()) {
      return query.valueLong(0);
   
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.