Package com.esri.gpt.framework.sql

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


      sbSql.append("SELECT DOCUUID, HOST_URL FROM ");
      sbSql.append(getResourceTableName(context));
      sbSql.append(" WHERE HOST_URL IS NOT NULL AND (APPROVALSTATUS='approved' OR APPROVALSTATUS='reviewed') ");
      sbSql.append(" AND UPDATEDATE >= ?");

      ManagedConnection mc = context.getConnectionBroker().returnConnection("");
      Connection con = mc.getJdbcConnection();
      st = con.prepareStatement(sbSql.toString());
      st.setTimestamp(1, getLastSynchronizationDate());

      rs = st.executeQuery();
View Full Code Here


    String sTable = this.getResourceTableName();
    String sDataTable = this.getResourceDataTableName();
    long id = doesRecordExist(sTable, sUuid);

    try {
      ManagedConnection mc = returnConnection();
      con = mc.getJdbcConnection();
      autoCommit = con.getAutoCommit();
      con.setAutoCommit(false);

      if (id < 0) {
View Full Code Here

          throws ImsServiceException, SQLException {
    PreparedStatement st = null;
    try {
      this.authorize(request, uuid);

      ManagedConnection mc = returnConnection();
      Connection con = mc.getJdbcConnection();
      IClobMutator cm = mc.getClobMutator();

      StringBuffer sql = new StringBuffer();
      sql.append("SELECT UPDATEDATE");
      sql.append(" FROM ").append(getResourceTableName()).append(" WHERE DOCUUID=?");
      logExpression(sql.toString());
View Full Code Here

      sbSql.append("UPDATE ").append(getHarvestingHistoryTableName()).append(" ");
      sbSql.append("SET HARVEST_REPORT=? ");
      sbSql.append("WHERE UPPER(UUID)=?");

      // establish the connection
      ManagedConnection mc = returnConnection();
      Connection con = mc.getJdbcConnection();
      IClobMutator cm = mc.getClobMutator();

      st = con.prepareStatement(sbSql.toString());
      int n = 1;
     
      // TODO: In rare cases setStream doesn't work correctly - looks like stream
View Full Code Here

    if (!isCatalogMetaAllowed()) {
      return;
    }

    ConnectionBroker connectionBroker = context.getConnectionBroker();
    ManagedConnection managedConnection = connectionBroker.returnConnection("");
    Connection conn = managedConnection.getJdbcConnection();

    boolean firstRecord = true;

    for (IFeedRecord record : records) {
      PreparedStatement st = null;
View Full Code Here

     
      ConnectionBroker connectionBroker = new ConnectionBroker();
      PreparedStatement st = null;
      ResultSet rs = null;
      try {
        ManagedConnection managedConnection = connectionBroker.returnConnection("");
        Connection connection = managedConnection.getJdbcConnection();
        st = connection.prepareStatement("SELECT COUNT(*) JOB_TYPE FROM GPT_HARVESTING_JOBS_COMPLETED WHERE HARVEST_ID=?");
        st.setString(1, record.getUuid());
       
        rs = st.executeQuery();
        if (rs.next()) {
View Full Code Here

   * @param protocolMap map of docuuid of sites on schedule and their corresponding protocol type
   * @return docuuid map
   * @throws SQLException if sql exception occurs
   */
  protected HashMap<String,String> collectSitesByProtocolType(HashMap<String, Object> protocolMap) throws SQLException {
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;
        HashMap<String,String> docuuidMap = new HashMap<String,String>();
      try
        st = con.prepareStatement(selectDistinctHarvestSitesOnScheduleOrderByProtocol());     
View Full Code Here

   * @return count value
   * @throws SQLException if sql exception occurs
   */
  protected int fetchCountByTime(String sql, int timePeriod) throws SQLException {
    int count = 0;
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;      
      try
        st = con.prepareStatement(sql);
        if(timePeriod != -1){
View Full Code Here

   * @param endDate the end date constraint
   * @throws Exception if exception occurs
   */
  protected void fetchCompleted(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 protocolMap the protocol type object map
   * @param docuuidMap the docuuid map of sites on schedule
   * @throws SQLException if sql exception occurs
   */
  protected void fetchDocumentCountByProtocol(HashMap<String, Object> protocolMap,HashMap<String,String> docuuidMap) throws SQLException {
     ManagedConnection mc = returnConnection();
        Connection con = mc.getJdbcConnection();
        ResultSet rs = null;
        PreparedStatement st = null;      
      try {
        ArrayList<String> sortedKeys=new ArrayList<String>(docuuidMap.keySet());
      Collections.sort(sortedKeys);
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.