简体   繁体   English

java.sql.SQLException:找不到数据

[英]java.sql.SQLException: No data found

I just want my record day wise, with sum of rate , tax & amount but differentiate it acc to tax, ie5% tax entries of a day sum up & in different row & 13% tax entries with sum will be a diff. 我只想明智地记录我的记录,以比率,税项和金额的总和来区分税项,即一天总和的5%税项和不同行的总和的13%税项是一个差异。 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 . 显示错误java.sql.SQLException:找不到数据。 help!! 救命!!

You are fetching String and Date both from index 1 , How is that possible 您正在从索引1提取String和Date,这怎么可能

rs.getString(1); <--- String Value at index 1
rs.getDate(1)); <---- Date  Value at index 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM