Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.sql.SQLException:未找到任何数据_Java_Mysql_Swing_Jcreator - Fatal编程技术网

java.sql.SQLException:未找到任何数据

java.sql.SQLException:未找到任何数据,java,mysql,swing,jcreator,Java,Mysql,Swing,Jcreator,我只希望我的记录按天计算,包括费率、税款和金额之和,但要根据税款进行区分,即一天中的5%税款分录汇总和在不同的行中,以及13%的税款分录汇总将是不同的行 try { Connection con=Conn.getConnection(); Statement ps=con.createStatement(); ResultSet rs=ps.executeQuery("Select Store, InvoiceDate, sum(Rate

我只希望我的记录按天计算,包括费率、税款和金额之和,但要根据税款进行区分,即一天中的5%税款分录汇总和在不同的行中,以及13%的税款分录汇总将是不同的行

    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());
    }

它显示错误java.sql.SQLException:找不到数据。救命

您正在从索引
1
获取字符串和日期,这怎么可能

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

rs.getString(1);查询中没有错误。没有语法错误