【发布时间】:2013-04-06 08:35:16
【问题描述】:
我有以下代码:
String sql = "SELECT * FROM users WHERE email = " + email;
prestat = DBConnection.prepareStatement(sql);
rs = prestat.executeQuery();
boolean isEmpty = !rs.first();
if (isEmpty) {
// Special marker for nonexistent user
return "$null";
} else if (password.equals(rs.getString(2))) {
String uuid = UUID.randomUUID().toString();
// Here I want to insert the UUID into the database
}
考虑到我已经搜索过数据库,我想知道是否有一种方法可以获取行号/位置,并使用它来更新 UUID 列,从而防止再次搜索数据库。
【问题讨论】:
-
我正在使用 Apache Derby。