that say I have a website,a use can login from facebook account.
when a user login from facebook account first time, my website will get and store from facebook into my database.
and check if your friend in facebook also register my website
Question:
if your friend in facebook also in my website, then insert friendship into database
If the user has 100 friends, then I need to check my database 100 times and insert 100 times?
for (List<User> myFeedConnectionPage : myFriends) {
for (User friend : myFeedConnectionPage) {
sql = "SELECT * FROM user WHERE fbID='" + friend.getId() + "'";
ResultSet rs = select(sql);
if (rs.next()) {
//save friend to friendship
friendList = friendList + "," + rs.getString("ID");
}
}
}
I am wondering if there has a better way to write it.
Thanks

New Topic/Question
Reply




MultiQuote




|