Commit 92671fca authored by pborate's avatar pborate

New scheduler for DWH_INV_SRET_SUM

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@212183 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d4c396e2
<%@ page import = "java.text.SimpleDateFormat"%>
<%@ page import = "ibase.utility.E12GenericUtility"%>
<%@ page import = "ibase.system.config.ConnDriver" %>
<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ page import="java.sql.*, java.util.*, java.net.*, oracle.jdbc.*, oracle.sql.*, oracle.jsp.dbutil.*"
%>
<%@page import ="ibase.webitm.utility.*"%>
<html>
<head>
<title>Execute DwhInvSretSum Procedure:</title>
</head>
<body>
<form >
From Date:<br>
<input type="date" id="fromDate" name="fromDate" value="">
<br>
To Date:<br>
<input type="date" id="toDate" name="toDate" value=""><br>
Item ser:<br>
<input type="string" id="itemSer" name="itemSer" value="">
<input type="hidden" id="returnMsg" name="returnMsg" value="">
<br><br>
<input type="submit" value="Procedure Call" >
</form>
<%
Connection con = null;
Statement st = null;
PreparedStatement ps=null;
ResultSet rs =null;
String returnMsg=null;
try {
returnMsg = request.getParameter("returnMsg");
String fromDate = request.getParameter("fromDate");
String toDate = request.getParameter("toDate");
String itemSer = request.getParameter("itemSer");
String tranDb = "";
E12GenericUtility utility = new E12GenericUtility();
String targetDateFormat=utility.getApplDateFormat();
String sourceDateFormat=utility.getDBDateFormat();
System.out.println("sourceDateFormat "+sourceDateFormat+" "+targetDateFormat);
System.out.println("toDate "+fromDate+" "+toDate);
ConnDriver connDriver = new ConnDriver();
if(fromDate != null && toDate != null)
{
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
tranDb = userInfo.getTransDB();
fromDate=utility.getValidDateString(fromDate, sourceDateFormat, targetDateFormat);
toDate=utility.getValidDateString(toDate, sourceDateFormat, targetDateFormat);
System.out.println("Inside DwhInvSretSum fromDate "+fromDate+" toDate "+toDate+" itemSer "+itemSer);
con = connDriver.getConnectDB(tranDb);
java.sql.CallableStatement cs = con.prepareCall("{CALL DWH_INV_SRET(?, ?, ?)}");
cs.setString(1,fromDate);
cs.setString(2,toDate);
cs.setString(3,itemSer);
cs.execute();
System.out.println("Execute successfully");
returnMsg="Execute successfully";
}
} catch(SQLException e)
{
System.out.println("Inside SQLException e:"+e);
}
catch(Exception ex)
{
%>
<div>Invalid Date</div>
<%
}
finally
{
if(st != null){
st.close();
}
if(rs != null){
rs.close();
}
if(con != null){
con.close();
}
}
if(returnMsg != null){
%>
<script>
document.getElementById('returnMsg').value = '<%=returnMsg%>';
</script>
<div><%=returnMsg%></div>
<%
}
%>
</center>
</body>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment