Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $
- .ajax({
- type: 'GET',
- url : "attendancePercentage",
- dataType: "json",
- data : {"stdate": stdate, "endate": endate},
- success : function(data, status) {
- alert(status);
- alert(data);
- }
- });
- List<StudentMark> stList = new ArrayList<StudentMark>();
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection(
- "jdbc:mysql://localhost:3306/test_schema", "root", "root");
- String sql = "select * from attendance where attendance.date>=? and attendance.date<=?";
- PreparedStatement pstmt = con.prepareStatement(sql);
- pstmt.setString(1, stDate);
- pstmt.setString(2, enDate);
- rs = pstmt.executeQuery();
- while (rs.next()) {
- StudentMark ge = new StudentMark();
- ge.setStudentName(rs.getString(3));
- ge.setDate(rs.getString(2));
- ge.setStatus(rs.getString(4));
- //System.out.println(("&&&&&..." + ge));
- stList.add(ge);
- //System.out.println("ge :" + ge.getStudentName()+","+ge.getDate()+","+ge.getStatus());
- }
- System.out.println("list>>"+stList);
- System.out.println("list>>"+json);//[{"","",""}]
- } catch (Exception e) {
- System.err.println(e.getMessage());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement