Package com.esri.gpt.framework.sql

Examples of com.esri.gpt.framework.sql.ManagedConnection


   * @throws Exception if exception occurs
   */
  protected void fetchHistory(String sql,String uuids, String startDate, String endDate) throws Exception{
   
    // establish the connection
        ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;
        try
     // initialize
        st = con.prepareStatement(sql);
View Full Code Here


   * @param endDate the end date constraint
   * @throws Exception if exception occurs
   */
  protected void fetchPending(String sql,String uuids, String startDate, String endDate) throws Exception {
    // establish the connection
        ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;
        try
     // initialize
        st = con.prepareStatement(sql);      
View Full Code Here

   */
  protected int[] fetchHarvestCounts(int timePeriod) throws Exception {
    int harvestedCount = 0;
    int publishedCount = 0;
    int validatedCount = 0;
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;   
        int[] counts = new int[3];       
      try
        st = con.prepareStatement(createHistoryCountsSQL(timePeriod));
View Full Code Here

   * Fetches Summary information for web harvester
   * @return the active and submitted count for web harvest jobs from pending table
   * @throws Exception if exception occurs
   */
  protected int[] fetchSummary() throws Exception {
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;      
        int activeCnt = 0;
        int submittedCnt = 0;
        int[] counts = new int[2];
View Full Code Here

   * @return map of protocol info objects
   * @throws Exception if exception occurs
   */
  protected HashMap<String, Object> fetchRepositoriesSummaryByProtocol() throws Exception {
    HashMap<String, Object> protocolMap = new HashMap<String,Object>();
    ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;      
      try
        st = con.prepareStatement(selectDistinctProtocols());     
        rs = st.executeQuery();
View Full Code Here

   * @param propertyName the property name of protocol info object
   * to populate count using sql
   * @throws SQLException if sql exception occurs
   */
  protected void populateProtocolInfo(HashMap<String, Object> protocolMap,String sql, String propertyName) throws SQLException{
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;      
      try
        st = con.prepareStatement(sql);     
        rs = st.executeQuery();
View Full Code Here

        this.writer = this.adapter.newWriter();
        this.adapter.setAutoCommitSingleWriter(false);
      }
     
      // initialize database
      ManagedConnection mc = this.context.getConnectionBroker().returnConnection("");
      this.con = mc.getJdbcConnection();
      this.mutator = mc.getClobMutator();
      this.resourceTable =  this.context.getCatalogConfiguration().getResourceTableName();
      this.resourceDataTable =  this.context.getCatalogConfiguration().getResourceDataTableName();
     
      // count current documents within the index and database
      CountInfo countInfo = new CountInfo();
View Full Code Here

      sb.append(" FROM ").append(resourceTable);
      sb.append(" WHERE DOCUUID IN (").append(sbIds.toString()).append(")");
      String sql = sb.toString();
      LOGGER.finest(sql);
     
      ManagedConnection mc = context.getConnectionBroker().returnConnection("");
      Connection con = mc.getJdbcConnection();
      IClobMutator mutator = mc.getClobMutator();
     
      st = con.prepareStatement(sql);
      ResultSet rs = st.executeQuery();
      if (Thread.interrupted()) return;
      while (rs.next()) {
View Full Code Here

  isGptAdministrator = new RoleMap(getRequestContext().getUser()).get("gptAdministrator");
 
  try {

    // establish the connection
    ManagedConnection mc = returnConnection();
    Connection con = mc.getJdbcConnection();
   
    // determine if the database is case sensitive
    StringAttributeMap params = getRequestContext().getCatalogConfiguration().getParameters();
    String s = Val.chkStr(params.getValue("database.isCaseSensitive"));
    boolean isDbCaseSensitive = !s.equalsIgnoreCase("false");
View Full Code Here

    if (!callback.isEmpty()) {
      responseWriter.print(callback+"({");
      responseWriter.flush();
    }
    writer.begin(response);
    ManagedConnection mCon = null;
    Connection con = null;
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
     
      // initialize the query string
      String table = context.getCatalogConfiguration().getResourceTableName();
      StringBuffer sql = new StringBuffer();
     
      String[] columnTags = {"id","uuid","protocol","name","url"};
      sql.append("SELECT ID,DOCUUID,PROTOCOL_TYPE,TITLE,HOST_URL FROM "+table);
     
      // build the bound query expression based upon HTTP parameter input
      HttpExpressionBinder binder = new HttpExpressionBinder(request);
      binder.parse("id","ID","=",",",HttpExpressionBinder.PARAMETERTYPE_INTEGER);
      binder.parse("uuid","DOCUUID",",",false,false);
     
      if(protocol.toLowerCase().equals("all")) {
        binder.parse("","PROTOCOL_TYPE",",",true,false);
      } else {
        binder.parse("protocol","PROTOCOL_TYPE",",",true,false);
      }
      binder.parse("name","TITLE",null,true,true);
      binder.parse("url","HOST_URL",null,true,true);
           
      // append the bound where clause,
      // create the prepared statement and apply bindings,
      // exexute the query and write the response
      sql.append(" ").append(binder.getExpression(true));
      if(sql.toString().toLowerCase().contains(" where ")) {
        sql.append(" AND ");
      } else {
        sql.append(" WHERE ");
      }
      sql.append(" ((APPROVALSTATUS = 'approved') ")
      .append(" OR  (APPROVALSTATUS = 'reviewed')) ");
      sql.append(" AND SEARCHABLE = 'true'");
      sql.append(" ORDER BY UPPER(TITLE) ASC");
     
      mCon = context.getConnectionBroker().returnConnection("");
      con = mCon.getJdbcConnection();
      st = con.prepareStatement(sql.toString());
      binder.applyBindings(st,1);
      //rs = new RepositoriesResultSetWrapper(st.executeQuery());
      if(protocol.toLowerCase().equals("all") != true) {
        rs = st.executeQuery();
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.sql.ManagedConnection

Copyright © 2018 www.massapicom. 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.