Environment
- JBoss 7.1.1
- MySQL 5.5
Note: Make sure the datasource is configured properly. Visit the post (http://vkslabs.com/adding-mysql-data-store-to-jboss-7-x/) to find out how to configure datasource.
Step 1: Configure persistence.xml
Create a file called persistence.xml and add the following content
<persistence 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_2_0.xsd" version="2.0"> <persistence-unit name="testjpa" transaction-type="RESOURCE_LOCAL"> <jta-data-source>java:jboss/datasources/myDS</jta-data-source> <class>com.test.StudentBean</class> <properties> <property name="hibernate.dialect" value="org...Read More





