private void pageView(ResponseHandler respHandle, String incStart, String incEnd) {
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=TemperatureSystemDB;user=JulianL;password=Indrak";
            Connection db = DriverManager.getConnection(connectionUrl);
            Statement stmt = db.createStatement();

            int entries = 0;
            ResultSet rowCount = stmt.executeQuery("SELECT COUNT(1) FROM TemperatureTable");
            while (rowCount.next()) {
                entries = rowCount.getInt(1);
            }

            String sql = "SELECT ID, Temperature, Date\n"
                    + "FROM (SELECT ROW_NUMBER() OVER (ORDER BY Date) AS RowNum, *\n"
                    + "From TemperatureTable )\n"
                    + "AS RowConstrainedResult\n"
                    + "WHERE   RowNum >= " + Integer.parseInt(incStart) + " AND RowNum < " + Integer.parseInt(incEnd) + "\n"
                    + "ORDER BY RowNum";
            ResultSet rs = stmt.executeQuery(sql);

            respHandle.printHeader("text/html");
            respHandle.printStyle(1);
            if (!rs.isBeforeFirst()) {
                respHandle.printText("<h1>Invalid database range. Please check the entered range and ensure that entries exist.</h1></body></html>\n");
            } else {
                respHandle.printText("<html><head></head><body><h1>Browsing database...</h1>"
                        + "<table>"
                        + "<thead><tr><th scope='col'>ID</th><th scope='col'>Temperature</th><th scope='col'>Date</th>"
                        + "</tr></thead><tbody>");
                while (rs.next()) {
                    respHandle.printText("<td>" + rs.getInt("ID") + "</td>");
                    respHandle.printText("<td>" + rs.getInt("Temperature") + "</td>");
                    respHandle.printText("<td>" + rs.getDate("Date") + "</td></tr>");
                }
                rs.close();
                respHandle.printText("</tbody></table>\n");

                int currentStart = Integer.parseInt(incStart);
                int currentEnd = Integer.parseInt(incEnd);
                int prevStart, prevEnd, nextStart, nextEnd;


                respHandle.printText("<table><tr>");
                if (currentStart > 1) {
                    if (currentStart - 20 <= 1) {
                        prevStart = 1;
                        prevEnd = 20;
                    } else {
                        prevStart = currentStart - 20;
                        prevEnd = currentStart - 1;
                    }
                    respHandle.printText("<td><a href='TemperatureSystem?action=showPage&pages=" + prevStart + "+" + prevEnd + "'>Previous</a></td>");
                }

                if (currentEnd <= entries) {
                    if (currentEnd + 20 >= (entries + 1)) {
                        nextEnd = entries + 1;
                        nextStart = entries - 18;
                    } else {
                        nextEnd = currentEnd + 20;
                        nextStart = currentEnd + 1;
                    }
                    respHandle.printText("<td><a href='TemperatureSystem?action=showPage&pages=" + nextStart + "+" + nextEnd + "'>Next</a></td>");
                }
                respHandle.printText("</tr></table>");
                respHandle.printText("</body></html>\n");
            }
        } catch (ClassNotFoundException ex) {
            System.out.println("MS JDBC Driver not installed\n" + ex);
        } catch (SQLException ex) {
            System.out.println("Could not load database\n" + ex);
        }
    }