Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws SQLException {
- Connection con = null;
- PreparedStatement pst = null;
- ResultSet rs = null;
- String cs = "URL";
- String user = "nina";
- String password = "ninaerkul";
- public double startdato;
- public double sluttdato;
- try {
- con = DriverManager.getConnection(cs, user, password);
- String query = "SELECT Count(treningsøktID), Sum(Varighet), Average(prestasjon), Max(personlig form) FROM treningsøkt WHERE startdato =< dato =< sluttdato";
- pst = con.prepareStatement(query);
- do {
- rs = pst.getResultSet();
- System.out.print("Dint beste treningsøkt i perioden" + startdato "" + sluttdato "var");
- System.out.println(rs.getString);
- }
- } finally {
- if (rs != null) {
- rs.close();
- }
- if (pst != null) {
- pst.close();
- }
- if (con != null) {
- con.close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement