怎么样输出我的数据
public class UserDAO extends DBConnection {public int flag;
public PreparedStatement ps;
public Connection conn;
public ResultSet rs;
public boolean refer(UserDTO dto) {
conn = getConnection();
String sql = "select * from tb_user where user_id=?";
try {
ps = conn.prepareStatement(sql);
ps.setInt(1, dto.getUser_id());
rs = ps.executeQuery();
if (rs.next()) {
int id = rs.getInt("user_id");
String name = rs.getString("user_name");
String pass = rs.getString("user_pass");
return true;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
close(conn, ps, rs);
}
return false;
}
}
问题:怎么样在main函数中输出id,name,pass?