vorrei stampare la somma delle colonne di un db mysql.
ho provato così ma mi dice che la colonna nn esiste anche se in verità esiste!!
codice:
    public static String sum() {
        String somma = "";
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://local/banca?user=user&password=pass");
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("select sum(entrate) from movimenti");
            somma = rs.getString("entrate");
            rs.close();
            stmt.close();
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e.getMessage());
        } finally {
            return "";
        }
    }