Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions run_tests.sh

This file was deleted.

5 changes: 2 additions & 3 deletions src/library/assistant/database/DataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public static boolean insertNewBook(Book book) {
}

public static boolean insertNewBook(Book book, Connection conn) {
try {
PreparedStatement statement = conn.prepareStatement(
"INSERT INTO BOOK(id,title,author,publisher,isAvail) VALUES(?,?,?,?,?)");
try (PreparedStatement statement = conn.prepareStatement(
"INSERT INTO BOOK(id,title,author,publisher,isAvail) VALUES(?,?,?,?,?)")) {
statement.setString(1, book.getId());
statement.setString(2, book.getTitle());
statement.setString(3, book.getAuthor());
Expand Down
1 change: 1 addition & 0 deletions test/library/assistant/database/DataHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void testInsertNewBook() throws SQLException {
verify(mockStmt).setString(4, "Test Publisher");
verify(mockStmt).setBoolean(5, true);
verify(mockStmt).executeUpdate();
verify(mockStmt).close();
}

@Test
Expand Down