public void cambiarPassword(String newpass, String nick){
 
 try {
            String queryString = "UPDATE Usuarios SET password=? WHERE nick=?";
            connection = getConnection();
            ptmt = connection.prepareStatement(queryString);
            ptmt.setString(1, newpass);
            ptmt.setString(2, nick);       
            ptmt.executeUpdate();
            System.out.println("Password cambiando");          
            
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (ptmt != null) {
                    ptmt.close();
                }
                if (connection != null) {
                    connection.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }

        }
 
 
 }