How to match unique ID from the different table in database and retrieve data according to that unique ID in Java?
-
03-06-2021 - |
質問
Table user in database(postgresql) has unique id for each user, dob, first and last names of the user; Table points in database has userID and gamePoints columns.
In java servlet, how do I match and retrieve who exactly that user is with points and output? Fuzzy Match??
example:
Table user:
userID-name-lastname-dob
1-Edward-Maka-1950
2-Kapu-Aka-1990
3-Park-Lewins-1993
Table points:
userID-gamePoints
1-320
3-3312
2-1001
解決
Isn't this just a matter or writing an appropriate query and parsing the results from the ResultSet in Java?
The query should be something like:
SELECT user.userID, user.name, user.lastname, user.dob, points.gamePoints
FROM user, points
WHERE user.userID = points.userID
AND (user.name = ? OR user.lastname = ?)
所属していません StackOverflow