永发信息网

private static List<String> getShopLists(int startRow, int endRow)

答案:2  悬赏:40  手机版
解决时间 2021-03-17 07:34
  • 提问者网友:wodetian
  • 2021-03-16 11:13
private static List<String> getShopLists(int startRow, int endRow) {
String sql = new String("select ShopInfo.ShopId,ShopKind,ShopName,ShopIntroduction,ShopPrice,ShopSellPrice,ShopNum from ShopInfo,ShopState where ShopInfo.ShopId = ShopState.ShopId limit "+startRow+","+endRow);
SQL javaSQL = new SQL();
Connection con = javaSQL.loadConnection();
Statement stmt = javaSQL.loadStatement();
ResultSet rs = javaSQL.loadResultSet(sql);
ShopInfoList.clear();
try {
while (rs.next()) {
StringBuffer line = new StringBuffer();
String ShopId = rs.getString(1);
String ShopKind = rs.getString(2);
String ShopName = rs.getString(3);

String ShopIntroduction = rs.getString(4);
String ShopPrice = rs.getString(5);
String ShopSellPrice = rs.getString(6);
String ShopNum = rs.getString(7);
rs.next();
提示错误
at com.Manager.ShopInfoDataModel.getShopLists(ShopInfoDataModel.java:34)
数据库驱动成功
连接数据库成功
de数据库驱动成功
连接数据库成功
SQLResultSet数据库链接失败
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.Manager.ShopInfoDataModel.getShopLists(ShopInfoDataModel.java:34)
最佳答案
  • 五星知识达人网友:封刀令
  • 2021-03-16 12:05
空指针,异常给你说的很清楚com.Manager.ShopInfoDataModel.getShopLists(ShopInfoDataModel.java:34)

中的第34行代码报了一个空指针。自己去看看哪里出了空吧
全部回答
  • 1楼网友:蕴藏春秋
  • 2021-03-16 13:27
具体的错误信息是怎样的 ~ ~ ~ ~ ~ ~ ~ ~
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯