无法在JSP中打印

时间:2016-01-03 14:39:37

标签: java jsp

以下是我在JSP文件中的Java代码:

  <%
            Dbase db = new Dbase();
            Connection conn = db.connect("jdbc:mysql://localhost:3306/fyp", "root", "");
            ResultSet rs;
            Statement stmt = conn.createStatement();
            List<String> listDate = new ArrayList<String>();
            List<Integer> listTemperature = new ArrayList<Integer>();
            String query = "select date from weatherData;";
            rs = stmt.executeQuery(query) ;
            int i = 0;

            while(rs.next()){
                listDate.add(rs.getString(1));
                out.println(listDate.get(i));
                i++;
            }

        %>

我正在尝试将这些元素打印出来但却失败了。没错。可能有什么不对?

0 个答案:

没有答案