From f00fd63cd8a4252d85f04359956d5f79036f0eb2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 15 Jul 2013 14:06:57 +0200 Subject: Add field for defaul note when adding new books This allows the user to use the note feature to track in which shelf a book is located without having to manually add the information to each newly added book. Signed-off-by: Florian Pritz --- src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java') diff --git a/src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java b/src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java index 9f06aba..352adf7 100644 --- a/src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java +++ b/src/com/joshwalters/bookcatalog/bookdatabase/BookDatabase.java @@ -211,12 +211,13 @@ public class BookDatabase { * @param Price * @param Publisher * @param Subject + * @param Notes * @throws SQLException * @throws BookAlreadyInDatabase */ public void insertBook(String Title, String Author, String Date, String Description, String ISBN, String Price, String Publisher, - String Subject) throws SQLException, BookAlreadyInDatabase { + String Subject, String Notes) throws SQLException, BookAlreadyInDatabase { // Check to see if the book is in the database if (!isBookInDatabase(ISBN)) { // The SQL statement @@ -231,8 +232,7 @@ public class BookDatabase { preparedStatement.setString(6, Price); preparedStatement.setString(7, Publisher); preparedStatement.setString(8, Subject); - // Set the notes for the book blank by default. - preparedStatement.setString(9, ""); + preparedStatement.setString(9, Notes); if (preparedStatement.execute()) { resultSet = statement.getResultSet(); if (resultSet != null) { -- cgit v1.2.3-24-g4f1b