Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这段代码是什么意思,friends表是怎么设计的 #3

Open
forTribeforXuanmo opened this issue Jan 2, 2018 · 0 comments
Open

Comments

@forTribeforXuanmo
Copy link

String sql = "SELECT * FROM friends WHERE username = ?"; try { pstmt = conn.prepareStatement(sql); pstmt.setString(1, username); resultSet = pstmt.executeQuery(); if (resultSet.next()) { for (int i = 1; i <= 20; i++) { if (resultSet.getString("friend_" + i) == null) { return "friend_" + i; } } }
字段的数量不算固定的吗,不算就两个字段,一个Username 一个friend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant