Rewrote a query that appears to have been written while on crack.

This commit is contained in:
akwizgran
2013-04-02 15:35:38 +01:00
parent 02c23f1378
commit 95484b5a00

View File

@@ -1340,11 +1340,11 @@ abstract class JdbcDatabase implements Database<Connection> {
String sql = "SELECT name, publicKey, privateKey FROM localAuthors"
+ " WHERE authorId = ?";
ps = txn.prepareStatement(sql);
ps.setBytes(1, a.getBytes());
rs = ps.executeQuery();
if(!rs.next()) throw new DbStateException();
AuthorId id = new AuthorId(rs.getBytes(1));
LocalAuthor localAuthor = new LocalAuthor(id, rs.getString(2),
rs.getBytes(3), rs.getBytes(4));
LocalAuthor localAuthor = new LocalAuthor(a, rs.getString(1),
rs.getBytes(2), rs.getBytes(3));
if(rs.next()) throw new DbStateException();
rs.close();
ps.close();