sql = "select member_id, first_name, middle_name, last_name, email, " +
"phone, home_address, office_address, home_phone, office_phone, singapore_nric " +
"from members, centers where member_id = ?";
}
Member member = null;
try (Connection connection = DriverManager.getConnection(Utils.getCloudSqlURL())) {
try (PreparedStatement ps = connection.prepareStatement(sql)) {
if (memberId == 0)
ps.setString(1, email.toLowerCase());
else {
ps.setInt(1, memberId);
}
try (ResultSet resultSet = ps.executeQuery()) {
while (resultSet.next()) {
member = new Member();
member.id = resultSet.getInt("member_id");
member.contactDetails.firstName = resultSet.getString("first_name");
member.contactDetails.lastName = resultSet.getString("last_name");
member.contactDetails.middleName = resultSet.getString("middle_name");