gpt4 book ai didi

java - 如何解决 java.lang.StackOverflowError

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:41:11 36 4
gpt4 key购买 nike

<分区>

这是我第一次遇到这个错误。此代码基本上获取在特定日期售出的每件商品的总和。

关于解决这个问题有什么建议吗?谢谢。

       Statement statement = connection.createStatement();
String query = "SELECT itemcode, SUM(quantity) AS 'Total Sales Per Day' "
+ "FROM sales "
+ "WHERE real_pur_date = '" + date + "' "
+ "GROUP BY itemcode ";
ResultSet rs = statement.executeQuery( query ); // this line gets the error / exception
while( rs.next() ){
Vector row = new Vector();
row.add( rs.getString( "itemcode" ) );
row.add( rs.getInt( "Total Sales Per Day" ) );
dailyData.add( row );
}
statement.close();
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at com.mysql.jdbc.Util.handleNewInstance(Util.java:431)
at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:383)
at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3140)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:491)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3118)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2288)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2709)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2627)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1556)
at posinventory.Controller.StatisticEngine.getDailyData(StatisticEngine.java:20)
at posinventory.Statistic.refreshTableDailyStat(Statistic.java:36)
at posinventory.Statistic.refreshTableDailyStat(Statistic.java:37)
at posinventory.Statistic.refreshTableDailyStat(Statistic.java:37)
at posinventory.Statistic.refreshTableDailyStat(Statistic.java:37)

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com