Modifier and Type | Field and Description |
---|---|
private Connection |
connection |
Constructor and Description |
---|
JDBCBookDAOImpl() |
Modifier and Type | Method and Description |
---|---|
Book |
create(Book book)
Add the book to the database.
|
List<Book> |
findAll(int start,
int count)
Returns a collection of books, starting at the index provided and
limiting the collection to the count value.
|
Book |
get(long id)
Gets a book from the database by its ID.
|
void |
remove(Book book)
Removes a book from the database.
|
void |
setConnection(Connection connection) |
Book |
update(Book book)
Updates the book in the database with the values in this object.
|
private Connection connection
public void setConnection(Connection connection)
public Book create(Book book) throws PersistenceException
BookDAO
create
in interface BookDAO
PersistenceException
public Book update(Book book) throws PersistenceException
BookDAO
update
in interface BookDAO
PersistenceException
public Book get(long id) throws PersistenceException
BookDAO
get
in interface BookDAO
PersistenceException
public void remove(Book book) throws PersistenceException
BookDAO
remove
in interface BookDAO
PersistenceException
public List<Book> findAll(int start, int count) throws PersistenceException
BookDAO
findAll
in interface BookDAO
PersistenceException
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.