Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

Creating Databases Table by Database Diagram Using JDeveloper 10.

g
Summary: This tutorial aims to introduce how to create database tables by Database Diagram using JDeveloper 10g. Requirement: Oracle database account and knowing how to create a connection to database. (see website: http://www.oracle.com/technology/obe/obe1013jdev/common/OBEConnection.htm) 1. Right click Applications to add the New Application

2. Then you can see a dialog. Choose Web Application (JSF, ADF, BC) as the application template. Click OK.

3. Right click on Application3 and choose New.

4. Open up the node of Business Tier, and choose ADF Business Components. Then you can see the right dialog will show an item called Business Components Project. Choose it and then click ok.

5. Click Next for next two processes. Then press Finish.

6. After clicking Finish on previous step, you can see a dialog for connecting your database. If you dont see this dialog, you need to create a connection to database first. Read the tutorial for creating a connection in ORCAL tutorial website at http://www.oracle.com/technology/obe/obe1013jdev/common/OBEConnection.htm

7. Press Next for next 5 steps to setup your connection of database. Then press Finish.

8. Right click on Project1 and choose New option.

9. Open up Database Tier and choose Offline Database Objects. Then click Database Diagram on the right dialog. Press OK

10. Put a name on this dialog. Then press OK.

11. In the Database Diagram, drag Table to the diagram, and name these tables as FACULTY and COURSE.

12. Double click FACULTY table, and use + button to create three columns with the following properties. Name Type FACULTY_NO Number FIRSTNAME VARCHAR2 LASTNAME VARCHAR2

13. Then, click Primary Key Information, and choose FACULTY_NO as a primary key with >button. Press OK

14. With the same step of 12, double click the table of COURSE, and input three columns with the following properties. Name Type COURSE_NO NUMBER COURST_TITLE VARCHAR2 FACULTY_NO NUMBER

15. Then click Primary Key Information, and choose COURSE_NO as a primary key with > button.

16. Then, press the Foreign Key Information. Push Add button to add a foreign key, and choose FACULTY as Referenced Table, then choose FACULTY_NO as a Local Column. Press OK.

17. Back to the diagram, you can see two tables have been setup

18. Right click on FACULTY table; on the menu, you can see an option called Generate. Choose it and its next menu will show Data Definition Language. Press it and go next step.

19. Press Next to start generate your tables in database.

20. Then press > to add COURSE to the right dialog. Push Next.

21. Select CREATE Objects. And click Next.

22. Then press Next button twice to Step 4 of 4, and select Perform Operation against the Database. Then, click Finish

23. After pushing Finish button, you will see a dialog shows a success message.

24. Choose Connections Navigator, and open up Tables. You will see FACULTY and COURSE table have been created successfully.

You might also like