Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/gazetteer/utils/DBService.java @ 22:2c6f44ef34ab
new: add comment textarea
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 23 Jun 2015 16:18:52 +0200 |
parents | 5b1856cd6b4f |
children | ce2e3f2814c0 |
comparison
equal
deleted
inserted
replaced
21:5b1856cd6b4f | 22:2c6f44ef34ab |
---|---|
703 DBBook book = this.bookMap.get(bookId); | 703 DBBook book = this.bookMap.get(bookId); |
704 book.setTocCorrection(finishedStatus); | 704 book.setTocCorrection(finishedStatus); |
705 | 705 |
706 | 706 |
707 } | 707 } |
708 | |
709 public void updateComment(String bookId, String comment) throws SQLException { | |
710 Connection conn = null; | |
711 Statement stmt = null; | |
712 | |
713 try { | |
714 String query = "UPDATE books SET comments='"+ comment + "' WHERE id='" + bookId + "'"; | |
715 conn = getNewConnection(); | |
716 stmt = conn.createStatement(); | |
717 int rs = stmt.executeUpdate(query); | |
718 | |
719 } catch (Exception e) { | |
720 e.printStackTrace(); | |
721 }finally{ | |
722 conn.close(); | |
723 } | |
724 | |
725 DBBook book = this.bookMap.get(bookId); | |
726 book.setComments(comment); | |
727 | |
728 | |
729 } | |
708 | 730 |
709 } | 731 } |