overview: this is my first tutorial on Websphere 7 Server and JPA 1.0 and EJB and Derby Database.
First: My data source name is EJB3BANK, and my target database is SHOP.
Second: this is persistence.xml file
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="ShopJPA" transaction-type="JTA"> <jta-data-source>jdbc/EJB3BANK</jta-data-source> <non-jta-data-source>jdbc/EJB3BANK</non-jta-data-source> <properties> <property name="openjpa.jdbc.Schema" value="SHOP" /> </properties> </persistence-unit> </persistence>
Third: this partial code Element object class
@Entity @Table(schema = "SHOP", name = "ITEM") @NamedQuery(name = "getItem", query = "SELECT i FROM Item i") public class Item{...}
Fourth: here is the CartBean business class, here is the beginning of the problem
@Stateful CartBean implements Cart{ .... .... public List<Item> getItems() { javax.persistence.Query query = em.createNamedQuery("getItem");
And this error message: The JDBC class name or DataSource class name must be specified in the ConnectionDriverName property . How to solve this problem?
source share