public item itemmessage1(int id ){ Connection conn=null; PreparedStatement st=null; ResultSet rs=null; try { conn=user.getconnection(); String sql="select * from chongqing where id=?;"; st=(PreparedStatement) conn.prepareStatement(sql); st.setInt(1, id); rs=st.executeQuery(); if(rs.next()) { item it=new item(); it.setId(rs.getInt("id")); it.setName(rs.getString("name")); it.setPrice(rs.getDouble("price")); it.setPicture(rs.getString("picture")); return it; }else { return null; } } catch (Exception e) { return null; }finally{ if(rs!=null) { try { rs.close(); rs=null; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(st!=null) { try { st.close(); st=null; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }}item it=read1.itemmessage1(Integer.parseInt(request.getParameter("id")));这句话出现了java.lang.NumberFormatException: null求大神解决
添加回答
举报
0/150
提交
取消