We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b7fb92 commit 86ab3e8Copy full SHA for 86ab3e8
1 file changed
src/com/urise/webapp/storage/SqlStorage.java
@@ -30,6 +30,7 @@ public void save(Resume resume) {
30
try {
31
ps.execute();
32
} catch (SQLException e) {
33
+ if(e.getSQLState().equals("23505"))
34
throw new ExistStorageException(resume.getUuid());
35
}
36
return null;
@@ -77,7 +78,7 @@ public List<Resume> getAllSorted() {
77
78
public int size() {
79
return sqlHelper.transactionExecute(ps -> {
80
ResultSet rs = ps.executeQuery();
- rs.next();
81
+ if (!rs.next()) {return 0;}
82
return rs.getInt(1);
83
}, "SELECT count (uuid) FROM RESUME");
84
0 commit comments