Step by step:
1. Install Eclipse 3.7.2 indigo ide for java-ee developer(http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr2)
2. Install Jboss Tools 3.3 for eclipse indigo (https://www.jboss.org/tools/download/installation/update_3_3.html)
3. Create a new Dynamic Web project under Jboss Central
![]() |
| Dynamic Web Project |
![]() |
| Project Facets |
6. Unfortunately, the configuration screen to build persistence.xml doesn't function very well, I need to manually modify it.
Following is the persistence.xml example to connect to postgresql:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="nbs_web" transaction-type="RESOURCE_LOCAL"
>
<class>com.etrade.managedbean.UserBean</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/test"/>
<property name="javax.persistence.jdbc.user" value="test"/>
<property name="javax.persistence.jdbc.password" value="test"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/test"/>
<property name="hibernate.default_schema" value="public"/>
<property name="hibernate.connection.username" value="test"/>
<property name="hibernate.connection.password" value="test"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
8. Following is the directory structure , where you should put your persistence.xml and postgresql driver:
9. Database setup is ready. Now we will need to do the java code.


