Package java.sql

Examples of java.sql.ResultSet.first()


            "where   site_id = '" + siteId + "' " +
            "and     report_name = ?";
        PreparedStatement countStatement = connection.prepareStatement(sql);
        countStatement.setString(1, reportName);
        ResultSet reportResult = countStatement.executeQuery();
        reportResult.first();
        int count = reportResult.getInt(1);
        if (count == 0) {
          insertStatement.setString(1, reportSet.getString("report_name"));
          insertStatement.setString(2, reportSet.getString("report_desc"));
          insertStatement.setString(3, reportSet.getString("report_text"));
View Full Code Here


            "and     ie_profile_type = ?";
        PreparedStatement countStatement = connection.prepareStatement(sql);
        countStatement.setString(1, ieProfileHeaderName);
        countStatement.setString(2, ieProfileType);
        ResultSet ieProfileResult = countStatement.executeQuery();
        ieProfileResult.first();
        int count = ieProfileResult.getInt(1);
        if (count == 0) {
          insertHeaderStatement.setString(1, ieProfileSet.getString("ie_profile_header_name"));
          insertHeaderStatement.setString(2, ieProfileSet.getString("ie_profile_type"));
          insertHeaderStatement.setString(3, siteId);
View Full Code Here

      //and apply those changes to the initial state before sending
      rs = contentQuery.executeQuery(buildChangeSetQuery(fileContentStart, start, path));
      rs.last();
      if (rs.getRow() != 0)
        {
        rs.first();
        for (rs.first(); !rs.isAfterLast(); rs.next())
          {
          if (rs.getString("ChangeType").equals("I"))
            {
            fileContents.insert(rs.getInt("ChangePos"), rs.getString("ChangeText"));
View Full Code Here

      rs = contentQuery.executeQuery(buildChangeSetQuery(fileContentStart, start, path));
      rs.last();
      if (rs.getRow() != 0)
        {
        rs.first();
        for (rs.first(); !rs.isAfterLast(); rs.next())
          {
          if (rs.getString("ChangeType").equals("I"))
            {
            fileContents.insert(rs.getInt("ChangePos"), rs.getString("ChangeText"));
            }
View Full Code Here

        if(rs.getRow() == 0)
          {
          rs.close();
          return;
          }
        rs.first();
      }
    catch (SQLException e)
      {
      throw new RuntimeException("error running client viewer query!", e);
      }
View Full Code Here

       
    try
      {
      //go to first row of result set and iterate to the last calling the docClient at
        //the specified interval
      for (rs.first(); !rs.isAfterLast() && resultThread == thisThread; rs.next())
        {
            //sleep for the required interval
          try
            {
            Thread.sleep(separationTime);
View Full Code Here

        // find the default network offering created for external devices during upgrade from 2.2.14
        try {
            pstmt = conn.prepareStatement("select id from `cloud`.`network_offerings` where unique_name='Isolated with external providers' ");
            rs = pstmt.executeQuery();
            if (rs.first()) {
                  networkOfferingId = rs.getLong(1);
            } else {
                  throw new CloudRuntimeException("Cannot upgrade as there is no 'Isolated with external providers' network offering crearted .");
            }
        } catch  (SQLException e) {
View Full Code Here

            try {
    // find the F5 device id  in the zone
                pstmt = conn.prepareStatement("SELECT id FROM host WHERE data_center_id=? AND type = 'ExternalLoadBalancer' AND removed IS NULL");
                pstmt.setLong(1, zoneId);
                rs = pstmt.executeQuery();
                if (rs.first()) {
                   f5HostId  = rs.getLong(1);
                } else {
                    throw new CloudRuntimeException("Cannot upgrade as there is no F5 load balancer device found in data center " + zoneId);
                }
                pstmt = conn.prepareStatement("SELECT id FROM external_load_balancer_devices WHERE  host_id=?");
View Full Code Here

                    throw new CloudRuntimeException("Cannot upgrade as there is no F5 load balancer device found in data center " + zoneId);
                }
                pstmt = conn.prepareStatement("SELECT id FROM external_load_balancer_devices WHERE  host_id=?");
                pstmt.setLong(1, f5HostId);
                rs = pstmt.executeQuery();
                if (rs.first()) {
                      f5DeviceId = rs.getLong(1);
                } else {
                    throw new CloudRuntimeException("Cannot upgrade as there is no F5 load balancer device with host ID " + f5HostId + " found in external_load_balancer_device");
                }
View Full Code Here

        // find the SRX device id  in the zone
                pstmt = conn.prepareStatement("SELECT id FROM host WHERE data_center_id=? AND type = 'ExternalFirewall' AND removed IS NULL");
                pstmt.setLong(1, zoneId);
                rs = pstmt.executeQuery();
                if (rs.first()) {
                      srxHostId = rs.getLong(1);
                } else {
                    throw new CloudRuntimeException("Cannot upgrade as there is no SRX firewall device found in data center " + zoneId);
                }
                pstmt = conn.prepareStatement("SELECT id FROM external_firewall_devices WHERE  host_id=?");
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.