0

I just want my record day wise, with sum of rate , tax & amount but differentiate it acc to tax, i.e.5% tax entries of a day sum up & in different row & 13% tax entries with sum will be a diff. row.

    try {

        Connection con=Conn.getConnection();
        Statement ps=con.createStatement();
        ResultSet rs=ps.executeQuery("Select Store, InvoiceDate, sum(Rate*quantity), Percen, sum(Tax*Quantity), sum(Amount) from Orders Group By InvoiceDate, Store, Percen");

        while(rs.next()){

            v=new Vector();

            v.add(rs.getString(1));
            v.add(converToString(rs.getDate(2)));
            v.add(rs.getDouble(3));
            v.add(rs.getString(4));
            v.add(rs.getDouble(5));
            v.add(rs.getDouble(6));

            mDateWise.addRow(v);
        }
        con.close();
    }
    catch (Exception ex) {

        JOptionPane.showMessageDialog(c,ex.toString());
    }

It's showing error java.sql.SQLException: No data found . help!!

1
  • no error in query. no syntax error Commented Mar 18, 2015 at 11:31

1 Answer 1

2

You are fetching String and Date both from index 1 , How is that possible

rs.getString(1); <--- String Value at index 1
rs.getDate(1)); <---- Date  Value at index 1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.