public static ArrayList<FlowControl> getFlowControlList() { ArrayList<FlowControl> flows = new ArrayList<FlowControl>(); ResultSet resultSet; try { connection = ConnectionHelper.sdeConnection(); Statement stmt = connection.createStatement(); String sql = "SELECT CSDAssetID, CSDFeatureID, '' AS PipeCSDAssetID, '' AS PipeCSDFeatureID, UpstreamPipeCSDAssetID, UpstreamPipeCSDFeatureID, " + "DownstreamPipeCSDAssetID, DownstreamPipeCSDFeatureID, FlowControlInputDate, FlowAllowed, FlowControlPosition, Subtype " + "FROM sde.SSCOMPLEXFLOWCONTROLHISTORY AS cf " + "WHERE (FlowControlInputDate = " + "(SELECT MAX(FlowControlInputDate) AS Expr1 " + "FROM sde.SSCOMPLEXFLOWCONTROLHISTORY AS cf2 " + "WHERE (CSDAssetID = cf.CSDAssetID) AND (CSDFeatureID = cf.CSDFeatureID))) " + "UNION " + "SELECT CSDAssetID, CSDFeatureID, PipeCSDAssetID, PipeCSDFeatureID, '' AS UpstreamPipeCSDAssetID, '' AS UpstreamPipeCSDFeatureID, " + "'' AS DownstreamPipeCSDAssetID, '' AS DownstreamPipeCSDFeatureID, FlowControlInputDate, FlowAllowed, FlowControlPosition, Subtype " + "FROM sde.SSFLOWCONTROLHISTORY AS f " + "WHERE (FlowControlInputDate = " + "(SELECT MAX(FlowControlInputDate) AS Expr1 " + "FROM sde.SSFLOWCONTROLHISTORY AS f2 " + "WHERE (CSDAssetID = f.CSDAssetID) AND (CSDFeatureID = f.CSDFeatureID))) " + "ORDER BY CSDAssetID"; resultSet = stmt.executeQuery(sql); while (resultSet.next()) { FlowControl flow = new FlowControl(); flow.setCsdAssetId(resultSet.getString(CSD_ASSET_ID)); flow.setCsdFeatureId(resultSet.getString("CSDFeatureID")); flow.setDownstreamPipeCsdAssetId(resultSet .getString("DownstreamPipeCSDAssetID")); flow.setDownstreamPipeCsdFeatureId(resultSet .getString("DownstreamPipeCSDFeatureID")); flow.setFlowAllowed(resultSet.getBoolean("FlowAllowed")); flow.setFlowControlInputDate(resultSet .getDate("FlowControlInputDate")); flow.setFlowControlPosition(resultSet .getString("FlowControlPosition")); flow.setPipeCsdAssetId(resultSet.getString("PipeCSDAssetID")); flow.setSubType(resultSet.getString("Subtype")); flow.setUpstreamPipeCsdAssetId(resultSet .getString("UpstreamPipeCSDAssetID")); flow.setUpstreamPipeCsdFeatureId(resultSet .getString("UpstreamPipeCSDFeatureID")); flows.add(flow); System.out.println("FlowList = " + flow.getCsdAssetId() + " : " + flow.getCsdFeatureId()); } // end while statement } catch (SQLException ex) { System.out.println(ex.getMessage()); } // end try-catch block finally { closeConnection(); } return flows; }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.