Examples of DbHelper


Examples of com.data2semantics.yasgui.server.db.DbHelper

 
  /**
   * Save the unique identifier in our DB. Store all user detail info as well if applicable
   */
  public void saveIdentifierForUniqueId(File configDir, UserDetails userDetails) throws ClassNotFoundException, FileNotFoundException, SQLException, IOException, org.json.JSONException, ParseException {
    DbHelper db = new DbHelper(configDir);
    db.storeUserInfo(userDetails);
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

    UserDetails userDetails = new UserDetails();
    userDetails.setOpenId(HttpCookies.getCookieValue(request, openIdCookieName));
    userDetails.setUniqueId(HttpCookies.getCookieValue(request, uniqueIdCookieName));
    if (userDetails.getOpenId() != null && userDetails.getUniqueId() != null) {
      //get more info
      DbHelper db = new DbHelper(configDir, request);
      userDetails = db.getUserDetails(userDetails);
    }
   
   
    return userDetails;
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

  public static void store(DbHelper dbHelper, String query, String endpoint, boolean debug) throws SQLException {
    QueryCompletionExtractor extractor = new QueryCompletionExtractor(dbHelper, query, endpoint, debug);
    extractor.analyzeAndStore();
  }
  public static void main (String[] args) throws ClassNotFoundException, FileNotFoundException, JSONException, SQLException, IOException, ParseException {
    DbHelper dbHelper = new DbHelper(new File("src/main/webapp/"));
    String query = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" +
        "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n" +
        "\n" +
        "SELECT DISTINCT * WHERE {\n" +
        "  ?bla rdf:type rdfs:Class\n" +
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

    return endpoints;
  }

  @Override
  public void addBookmark(Bookmark bookmark) throws IllegalArgumentException, FetchException, OpenIdException {
    DbHelper db = null;
    try {
      db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
      db.addBookmarks(bookmark);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } finally {
      if (db != null)
        db.close();
    }
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

public class AutocompletionsInfoResponseCreator {
 
  private DbHelper dbHelper;

  private AutocompletionsInfoResponseCreator(HttpServletRequest request, HttpServletResponse response, File webappDir) throws ClassNotFoundException, FileNotFoundException, JSONException, SQLException, IOException, ParseException {
    this.dbHelper = new DbHelper(webappDir, request);
   
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

        db.close();
    }
  }

  public Bookmark[] getBookmarks() throws IllegalArgumentException, FetchException, OpenIdException {
    DbHelper db = null;
    Bookmark[] bookmarks = null;
    try {
      db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
      bookmarks = db.getBookmarks();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } finally {
      if (db != null)
        db.close();
    }
    return bookmarks;
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

    return bookmarks;
  }

  @Override
  public void updateBookmarks(Bookmark[] bookmarks) throws IllegalArgumentException, FetchException, OpenIdException {
    DbHelper db = null;

    try {
      db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
      db.updateBookmarks(bookmarks);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } finally {
      if (db != null)
        db.close();
    }
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

    }
  }

  @Override
  public void deleteBookmarks(int[] bookmarkIds) throws IllegalArgumentException, FetchException, OpenIdException {
    DbHelper db = null;
    try {
      db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
      db.clearBookmarks(bookmarkIds);
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } finally {
      if (db != null)
        db.close();
    }
  }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

  }

  @Override
  public void logLazyQuery(String query, String endpoint) throws IllegalArgumentException, EndpointIdException {
    try {
      QueryCompletionExtractor.store(new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest()), query, endpoint);
    } catch (EndpointIdException e) {
      throw e;
    } catch (Exception e) {
      throw new IllegalArgumentException(e.getMessage());
    }
View Full Code Here

Examples of com.data2semantics.yasgui.server.db.DbHelper

  }

  @Override
  public AutocompletionsInfo getAutocompletionsInfo() throws IllegalArgumentException, FetchException {
    try {
      DbHelper db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
      return db.getAutocompletionInfo();
    } catch (Exception e) {
      throw new FetchException(e.getMessage());
    }
  }
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.