Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Display parent and child records sequentially

Marco FoxxMay 21 2020 — edited Jun 18 2020

Hello,

I have been trying to display records sequentially, so i want to display first record from parent table and then every records from child table. Let's say there are 4 parent records under each there are 10 child records. So first i will display 1st record from parent and then it's 10 child records. Again display 2nd record from parent and it's 10 records from child table and so on.

Here I am using EMP and DEPT table. Also if we can display sum of salary at the end of child record.

Output:

pastedImage_0.png

CREATE TABLE "EMP"

( "EMPNO" NUMBER(4,0),

"ENAME" VARCHAR2(10 BYTE),

"JOB" VARCHAR2(9 BYTE),

"MGR" NUMBER(4,0),

"HIREDATE" DATE,

"SAL" NUMBER(7,2),

"COMM" NUMBER(7,2),

"DEPTNO" NUMBER(2,0)

);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7369,'SMITH','CLERK',7902,to_date('17-DEC-80','DD-MON-RR'),5001,null,20);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7499,'ALLEN','SALESMAN',7698,to_date('20-FEB-81','DD-MON-RR'),1601,300,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7521,'WARD','SALESMAN',7698,to_date('22-FEB-81','DD-MON-RR'),1251,500,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7566,'JONES','MANAGER',7839,to_date('02-APR-81','DD-MON-RR'),2976,null,20);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7654,'MARTIN','SALESMAN',7698,to_date('28-SEP-81','DD-MON-RR'),1251,1400,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7698,'BLAKE','MANAGER',7839,to_date('01-MAY-81','DD-MON-RR'),2851,null,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7782,'CLARK','MANAGER',7839,to_date('09-JUN-81','DD-MON-RR'),2451,null,10);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7788,'SCOTT','ANALYST',7566,to_date('19-APR-87','DD-MON-RR'),3001,null,20);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7839,'KING','PRESIDENT',null,to_date('17-NOV-81','DD-MON-RR'),5001,null,10);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7844,'TURNER','SALESMAN',7698,to_date('08-SEP-81','DD-MON-RR'),1501,0,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7876,'ADAMS','CLERK',7788,to_date('23-MAY-87','DD-MON-RR'),1101,null,20);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7900,'JAMES','CLERK',7698,to_date('03-DEC-81','DD-MON-RR'),951,null,30);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7902,'FORD','ANALYST',7566,to_date('03-DEC-81','DD-MON-RR'),3001,null,20);

Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7934,'MILLER','CLERK',7782,to_date('23-JAN-82','DD-MON-RR'),1301,null,10);

create table dept(

deptno number(2,0),

dname varchar2(14),

loc varchar2(13)

);

insert into dept values(10, 'ACCOUNTING', 'NEW YORK');

insert into dept values(20, 'RESEARCH', 'DALLAS');

insert into dept values(30, 'SALES', 'CHICAGO');

insert into dept values(40, 'OPERATIONS', 'BOSTON');

Thank you.

This post has been answered by Frank Kulash on May 21 2020
Jump to Answer

Comments

Narayan
HI user,

I think you mean the multi-Scene Interface , if so then In javafx you can change many scenes in a single Stage so that you can swap those scene. All things in the JavaFX is customizable.

Simple going code:
private Scene s1,s2;
private Stage stage;

public void start(Stage stage) {
	this.stage = stage;
	s1 = new Scene(panel1); //Contains the first window element
	s2 = new Scene(panel2)  //Contains the second window elements
	stage.setScene(s1);
}


//Anywhere in the code after certain condition matches in existing class
this.stage.setScene(s2); //this code changes the scene of your main program Stage/Window
For more about this you can head toward the Stage and Scene API

Thanks
Narayn
986307
Hi Narayan,

In your example there is only one scene visible at time.

What I'm looking for is JavaFX version of Swing JDesktopPane which can serve as container for individual "child" JInternalFrames frames.
If you minimize child frame, icon of it is located on the bottom of the container pane instead of Windows task bar.
You can have several child frames and they can overlap each other. You cannot move child frame out of the container.

http://en.wikipedia.org/wiki/Multiple_document_interface

http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
986307
There is an old thread about JDesktopPane here: 10057351

Using Netbeans or Eclipse platform only for this purpose sounds a bit heavy solution.
Narayan
Hi user,
Currently there is nothing like that in JavaFX internal API. But you can use third party free library like JFXTras.
They already have the VFXWindow class which helps to run the multiple window inside the window like the JInternalFrame of Swing.

Or Alternatively you can even make the custom as well. It's all about the Layouts and the Node. :)


-------------
Links to the VFXWindows library:
- http://jfxtras.org
- http://www.youtube.com/watch?v=QH_A9rWc4zg


Thanks
Narayan
JAVA_AGM

HI

Can u please send me the implementaion details of MDI using swing in javafx.

It will be helpful for me.

1 - 5

Post Details

Added on May 21 2020
4 comments
1,104 views