I suppose that you are using Eclipse:
1. Create an EJB3 project
2. Write an
ANT file that will compile your EJB classes and deploy them to JBoss
for the persistence.xml file
you should provide something like this:
finally you need a Data Source to connect to the Database, you could find most Database data sources under the directories of JBoss for JBoss 5 its under you will find them under the directory <JBoss>/docs/examples/jca
choose the appropriate data source for you database and modify it.