Manish kumar

Manish kumar

  • NA
  • 30
  • 9k

Can any body resolve my error to getting running-total amoun

Dec 2 2016 12:59 AM

As per your link i have followed above this website tutorial, but my tomcat local server is response successful but no data have occurred with MS-ACCESS DATA TABL,

my tomcat local server is response successful but no data have occurred with MS-ACCESS DATA TABEL

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>

<%@page import="java.sql.*"%>

<%@ page import="java.util.Calendar" %>

<% //java Code 28/11/2016

try

{

String date = (new java.util.Date()).toString();

String OrderDate=request.getParameter("OrderDate");

int OrderID = Integer.parseInt(request.getParameter("OrderID"));

int Amount = Integer.parseInt(request.getParameter("Amount"));

int Running_Total=Integer.parseInt(request.getParameter("Running_Total"));

String sql_debit="select OrderID,OrderDate,Amount,(select sum(Amount) from CustomerOrders where OrderID <= OrderID)'Running_Total' from CustomerOrders";

String s="jdbc:odbc:Database2";

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection conn=DriverManager.getConnection(s);

Statement pstmt=conn.createStatement();

Calendar calendar = Calendar.getInstance();

java.sql.Date startDate = new java.sql.Date(calendar.getTime().getTime());

ResultSet result = pstmt.executeQuery(sql_debit);

while (result.next())

{ /

//OrderID=result.getInt("OrderID");

//OrderDate=result.getDate("startDate");

//Amount= result.getDate("Amount");

//Running_Total= result.getInt("Running_Total");

result.getInt(1);

result.getDate(2);

result.getInt(3);

result.getInt(4);

System.out.println("Sucessfuly Running_Total");

}

conn.close();

}

catch(Exception ex)

{

System.err.println(ex.getMessage());

}

%>


Answers (1)