Ha! After a lot of tooling around I managed to get it working by adding a new 'persistence Unit' to the 'persistence.xml' file. I went with the default options, their values posted below:
<?xml version="1.0" encoding="UTF-8"?> <persistence-unit name="bookstorePU" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <properties> <property name="eclipselink.jdbc.password" value="app"/> <property name="eclipselink.jdbc.user" value="app"/> <property name="eclipselink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/> <property name="eclipselink.jdbc.url" value="jdbc:derby://localhost:1527/sample"/> <property name="eclipselink.ddl-generation" value="create-tables"/> </properties> </persistence-unit> </persistence> It's noteworthy it's using 'sample' database, and not the 'BookDB' database I set up. Also, I don't see 'BookDB' listed under Server's 'resources'; Netbeans=>Services=>GlassFish v3=>Resources=>JDBC, etc... stephen wille | p.stephenwi...@yahoo.com ________________________________ From: diegosouza.br <diegosouza...@gmail.com> To: Java EE (J2EE) Programming with Passion! <java-ee-j2ee-programming-with-passion@googlegroups.com> Sent: Friday, September 18, 2009 7:11:05 AM Subject: [java ee programming] Re: Bookstore1 DB error... Hello, That's it. Open the aggregated project (bookstore), change the JDBC DataSource address and rebuild it to generate a new jar. So if you rebuild the bookstore1 project I think everything is going to run properly. Tell me the result. On Sep 17, 4:58 pm, "p. stephen wille" <p.stephenwi...@yahoo.com> wrote: > Thanks for the tip.>>Persistence.xml is using the [jdbc/__default] database, > and I think I want it to use [jdbc/BookDB], which is the DB I set up. > However, changing this field in the file does not allow for a successful > build. Do I need to create a new Jar of [bookstore], then remove the current > [bookstore] jar from [bookstore1] and re-associate it with the new updated > jar? I'm asking this I'm getting ready to try it, but any comments are truly > appreciated. > > > stephen wille | p.stephenwi...@yahoo.com > > ________________________________ > From: diegosouza.br <diegosouza...@gmail.com> > > >To: Java EE (J2EE) Programming with Passion! > ><java-ee-j2ee-programming-with-passion@googlegroups.com> > >Sent: Wednesday, September 16, 2009 7:54:52 PM > >Subject: [java ee programming] Re: Bookstore1 DB error... > > >Hello! > > >When you run bookstore1, it uses the bookstore.jar to connect to the > >Data Source specified in persistence.xml. > >See the libraries in your bookstore1 project, then right click the > >bookstore.jar and click "open project". Expand the META-INF node and > >>verify the persistence.xml. I think it's pointing to another Data > >Source address. > > >Good luck! > > >On Sep 16, 8:43 pm, "p. stephen wille" <p.stephenwi...@yahoo.com> > >>wrote: > >> Anyone know anything about this issue? > > >> Per the instructions on p.97, I've added [jdbc/BookDB]. I also populated > >> the database with an sql file I found > >> [..\javaeetutorial5\examples\common\sql\javadb]. However, I get the error > >> message below when I run [bookstore1]. > > >> Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.0.1 (Build > >> 20080905)): > > > org.eclipse.persistence.exceptions.DatabaseException > >> Internal Exception: java.sql.SQLTransientConnectionException: No current > >> connection. > >> Error Code: 40000 > >> Call: SELECT BOOKID, DESCRIPTION, INVENTORY, TITLE, PRICE, FIRSTNAME, > >> SURNAME, CALENDAR_YEAR, ONSALE FROM WEB_BOOKSTORE_BOOKS WHERE (BOOKID = ?) > >>> bind => [203] > > >> Query: ReadObjectQuery(com.sun.bookstore.database.Book) > >> I can run the select statement successfully in Netbeans, so the > >> database exists and is populated. For example, The record returned for > >>> [BookID = 202] is 'web servers for fun and profit'. > >> I've confirmed the DB and connection pool are running - > > >> asadmin> list-jdbc-resources > >> jdbc/__TimerPool > >> jdbc/__CallFlowPool > >>> jdbc/__default > >> jdbc/BookDB > >> Command list-jdbc-resources executed successfully. > > > asadmin> list-jdbc-connection-pools > >> __CallFlowPool > >> __TimerPool > >> DerbyPool > >> Command list-jdbc-connection-pools executed successfully. > > >> Suggestions? > > >> stephen wille | p.stephenwi...@yahoo.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---