Task #1
Copy the mysql-ds.xml from directory - jboss-4.2.2.GA\docs\examples\jca\Edit it (jndi-name is used later)
Paste it into directory - jboss-4.2.2.GA\server\all\deploy\
Task #2
Paste all JARs related to database driver into directory - jboss-4.2.2.GA\server\all\lib\Task #3
Select Application Server -> Jboss -> Jboss 4.xChoose “Enable”
Click on “Browse” for Jboss home directory eg. C:\ jboss-4.2.2.GA
Enter “Server name” as all
Click “OK”
Task #4
Step 1: File -> New -> Enterprise Application projectStep 2: Enter “Project Name”
Check “Use Default Loaction”
Choose “Java EE 5.0”
Check “New web module project” and “New EJB module project”
Step 3: Press “Next” button (it will show web project module detail)
Step 4: Press “Next” button (it will show EJB project module detail)
Check “ Add support for entity beans (add JPA capabilities)”
Press “Next” button
Step 5: Click on “Create new Driver”
Select “Driver template” eg. MySQL Connector/J
Click on “Add JARs” and browse for JARs
Select “Driver classname” eg. com.mysql.jdbc.Driver
Enter “Driver name” eg. com.mysql.jdbc.Driver
Edit “Connection URL” eg. jdbc:mysql://localhost:3306/test
Enter “User name”
Enter “Password”
Check “Save password”
Step 6: Choose “Display the selected schemas”
Press “Add” button then click “OK”
Select schema to be displayed {test} then click “OK” then click “Finish”
Step 7: click “Update List” and select “Catalog/Schema”
Enter “JNDI Data Source” eg. java:{jndi-name in mysql-ds.xml file}
Task #5
Step 1: Right Click on EJB-Module -> MyEclipse ->Generate Entities..Step 2: Select form “Available tables” and then “Add”
Click on “Next”
Step 3: Browse for Destination “Java Package”
Check “Entity Bean Generation”
Check “Entity facade”, “findby methods” and “Generate remote interface”
Click on “Next”
Step 4: click on “Next”
Step 5: all checkbox unchecked
Click on “Finish”
Click on “OK”
No comments:
Post a Comment