[jboss-user] [Beginner's Corner] - EJB 3 Outside the Container.

R Saravana Prasad do-not-reply at jboss.com
Sun Sep 9 08:15:51 EDT 2012


R Saravana Prasad [https://community.jboss.org/people/rsprasad] created the document:

"EJB 3 Outside the Container."

To view the document, visit: https://community.jboss.org/docs/DOC-28898

--------------------------------------------------------------
*Getting started on ejb3s outside the container:*

The attached rar file has an application that uses ejb3 persistence outside the container 
that can be run by from ant on command line.
Though the build script refers jars from jboss, jboss need not be running. 

*Persistence Provider:*

Since a EJB 3.0 persistence layer is required, Hibernate is used as persistence provider.
Refer Persistence.xml file for configuration of Hibernate and build.xml for required JBoss and Hibernate lib files.
Uses annotations and no xml mapping files. 

*Required SQL Script:*

1) Create a table om MS-SQL Server
        CREATE TABLE Product (
          productId INTEGER IDENTITY(1,1) NOT NULL PRIMARY KEY,
          productName varchar(25),
          productDescription varchar(25)
        );

2) select * from product

*Ant sequence:*

1) ant jar
2) ant -Dargs0=productName -Dargs1=productDescription run 
-> this ant task creates a record and also lists all records after the latest insert.

Fire up the Jboss and pull up the app.

Saravana Prasad  R
--------------------------------------------------------------

Comment by going to Community
[https://community.jboss.org/docs/DOC-28898]

Create a new document in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120909/a5d6bf71/attachment.html 


More information about the jboss-user mailing list