<%-- 
    Document   : DynamicInttCategory
    Created on : Mar 9, 2016, 6:27:36 PM
    Author     : Tcs Helpdesk10
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="DataEntryBean.AccountCreationBean"%>
<%@page import="DataEntryBean.GlProductOperationBean"%>
<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="controller.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <title>Dynamic Drop Down</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="${pageContext.request.contextPath}/js/Calendar.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/styles.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/info.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/js/iFrame_killer.js"></script>
    </head>
    <body>
        <%
            Connection connection = null;
            ResultSet rs = null;
            ResultSet rs_pname = null;
            Statement statement = null;
            connection = DbHandler.getDBConnection();
            try {
                AccountCreationBean oAccountCreationBean = new AccountCreationBean();
                ArrayList<AccountCreationBean> alAccountCreationBean = new ArrayList<AccountCreationBean>();
               // String str = request.getParameter("handle_id");
                statement = connection.createStatement();
               // rs = statement.executeQuery("select prod_code,prod_desc,int_cat,intt_cat_desc from dep_product where prod_code='" + str + "'");
                while(rs.next()){
                  
                oAccountCreationBean = new AccountCreationBean();
                oAccountCreationBean.setId(str);
                oAccountCreationBean.setProductCode(rs.getString("prod_code"));
                oAccountCreationBean.setProductName(rs.getString("prod_desc"));
                oAccountCreationBean.setInttCategory(rs.getString("int_cat"));
                oAccountCreationBean.setInttDescription(rs.getString("intt_cat_desc"));
                
                alAccountCreationBean.add(oAccountCreationBean);
                
                }
                
                request.setAttribute("oAccountCreationBeanObj", alAccountCreationBean);
                request.setAttribute("flag", 'Y');
                request.getRequestDispatcher("/accountCreation.jsp").forward(request, response);
               // statement.close();
               //connection.close();

            } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }

        %>  
    </body>
</html>
