|
From: Pelle B. <pe...@us...> - 2004-03-23 22:11:54
|
Update of /cvsroot/neuclear/neuclear-ledger-sql/src/java/org/neuclear/ledger/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14187/src/java/org/neuclear/ledger/sql Modified Files: SQLLedger.java Log Message: Bumped version numbers for commons and xmlsig througout. Updated repositories and webservers to use old.neuclear.org Various other fixes in project.xml and project.properties on misc projects. Index: SQLLedger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger-sql/src/java/org/neuclear/ledger/sql/SQLLedger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SQLLedger.java 22 Mar 2004 20:08:09 -0000 1.1 --- SQLLedger.java 23 Mar 2004 22:01:22 -0000 1.2 *************** *** 49,53 **** */ public SQLLedger(final StatementFactory fact, final String id) throws LowlevelLedgerException, UnknownLedgerException { ! super(id, "sql ledger"); this.fact = fact; create(fact); --- 49,53 ---- */ public SQLLedger(final StatementFactory fact, final String id) throws LowlevelLedgerException, UnknownLedgerException { ! super(id); this.fact = fact; create(fact); *************** *** 124,163 **** } - /** - * This decides if new books are automatically created. - * - * @return - */ - public final boolean allowAutoBookCreation() { - return false; - } - - public final boolean bookExists(final String bookID) throws LowlevelLedgerException { - try { - final PreparedStatement stmt = prepQuery("select id from book where id=?"); - stmt.setString(1, bookID); - final ResultSet rs = stmt.executeQuery(); - return rs.next(); - } catch (SQLException e) { - throw new LowlevelLedgerException(this, e); - } - } - - public final Book createNewBook(final String bookID, final String title) throws BookExistsException, LowlevelLedgerException { - if (bookExists(bookID)) - throw new BookExistsException(this, bookID); - try { - final PreparedStatement stmt = prepQuery("insert into book values (?,?,now())"); - stmt.setString(1, bookID); - stmt.setString(2, title); - stmt.execute(); - return createBookInstance(bookID, title); - } catch (SQLException e) { - rollbackUT(); - throw new LowlevelLedgerException(this, e); - } - - } - /* (non-Javadoc) * @see org.neuclear.ledger.Ledger#performTransaction(org.neuclear.ledger.UnPostedTransaction) --- 124,127 ---- *************** *** 174,180 **** insertTransactionItem(xid, item); } ! return this.createTransaction(transaction, xid); } catch (SQLException e) { - rollbackUT(); throw new LowlevelLedgerException(this, e); } --- 138,143 ---- insertTransactionItem(xid, item); } ! return new PostedTransaction(transaction, new Date()); } catch (SQLException e) { throw new LowlevelLedgerException(this, e); } *************** *** 200,204 **** insertHeldTransactionItem(xid, item); } ! return this.createHeldTransaction(transaction, xid); } catch (SQLException e) { rollbackUT(); --- 163,167 ---- insertHeldTransactionItem(xid, item); } ! return new PostedHeldTransaction(transaction, new Date()); } catch (SQLException e) { rollbackUT(); |