Package cx.fbn.nevernote.sql.driver

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


  public String getNotebookGuid(String guid) {
    boolean check;
         
        NSqlQuery query = new NSqlQuery(db.getConnection());
               
    check = query.prepare("Select notebookGuid "
        +"from LinkedNotebook where guid=:guid");
    query.bindValue(":guid", guid);
    check = query.exec();
    if (!check)
      logger.log(logger.EXTREME, "LinkedNotebook SQL retrieve of notebookguid by guidhas failed.");
View Full Code Here


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

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

  // does a record exist?
  public String findNotebookByShareName(String name) {
    
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Select guid from Linkednotebook where shareName=:name");
    query.bindValue(":name", name);
    if (!query.exec())
      logger.log(logger.EXTREME, "Linked notebook SQL retrieve by share name has failed.");
    String val = null;
    if (query.next())
View Full Code Here

  // does a record exist?
  public String setNotebookGuid(String shareKey, String notebookGuid) {
    
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update LinkedNotebook set notebookGuid=:notebookGuid where shareKey=:shareKey");
    query.bindValue(":notebookGuid", notebookGuid);
    query.bindValue(":shareKey", shareKey);
    if (!query.exec())
      logger.log(logger.EXTREME, "Linked notebook SQL retrieve by share name has failed.");
    String val = null;
View Full Code Here

  // set sync date
  public String setLastSequenceDate(String guid, long date) {
    
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update LinkedNotebook set lastsequencedate=:date where guid=:guid");
    query.bindValue(":date", date);
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Linked notebook SQL retrieve by share name has failed.");
    String val = null;
View Full Code Here

  // set sync number
  public String setLastSequenceNumber(String guid, int number) {
    
    NSqlQuery query = new NSqlQuery(db.getConnection());
   
    query.prepare("Update LinkedNotebook set lastsequencenumber=:number where guid=:guid");
    query.bindValue(":number", number);
    query.bindValue(":guid", guid);
    if (!query.exec())
      logger.log(logger.EXTREME, "Linked notebook SQL retrieve by share name has failed.");
    String val = null;
View Full Code Here

  //****************************************************************
  //* Check if a table exists
  //****************************************************************
  public boolean dbTableExists(String name) {
        NSqlQuery query = new NSqlQuery(getConnection());
        query.prepare("select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME=:name");
        query.bindValue(":name", name.toUpperCase());
        query.exec();
        if (query.next())
          return true;
        else
View Full Code Here

        newnote.setGuid("1");
       
        // Setup an initial notebook
    SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
        query = new NSqlQuery(db.getConnection());
    query.prepare("Insert Into "+dbName+" (guid, sequence, name, defaultNotebook, "
        +"serviceCreated, serviceUpdated, published, "  
        + "isDirty, autoEncrypt, "
        + "local, archived) Values("
        +":guid, :sequence, :name, :defaultNotebook,  "
        +":serviceCreated, :serviceUpdated, :published, "
View Full Code Here

  public void addNotebook(Notebook tempNotebook, boolean isDirty, boolean local, boolean linked, boolean readOnly) {
    boolean check;
   
    SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
        NSqlQuery query = new NSqlQuery(db.getConnection());
    check = query.prepare("Insert Into "+dbName+" (guid, sequence, name, defaultNotebook, "
        +"serviceCreated, serviceUpdated, published, "  
        + "publishingUri, publishingOrder, publishingAscending, publishingPublicDescription, "
        + "isDirty, autoEncrypt, stack, "
        + "local, archived, readOnly, linked) Values("
        +":guid, :sequence, :name, :defaultNotebook,  "
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.