Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

How to save data in Master-Detail tables with seq PKs in Java?

GadoMay 23 2017 — edited May 23 2017

Hello Experts,

I'm building a Sales Order application.

And now i'm stuck in how to save the sales Order.

I know how to insert records in a single database table ... but now i want to save in both tables.

I want to insert a record in the master SalesOrder table and the items in the detail SalesOrderItems at the same time.

The Primary keys in both tables are assigned using a database sequence so i don't know how to handle the relation between them

There is no way to know the SalesOrder (Master)'s PK to assign as a FK in the SalesOrderItems (Detail) table at the time i'm saving the data.

Is this possible?

Thank you for your time

Gado

Comments

Shay Shmeltzer-Oracle

Also check the JDev project properties for the setting in the compiler section.

Kareem Wahba

thanks for your reply , i do that but it's not working

SanjeevChauhan

I think at runtime also your weblogic (jvm) should support UTF-8. Can you please set utf-8 encoding for JVM by modifying setDomainEnv.sh/setDomainEnv.cmd file present in you domain/bin directory.

You may need to add JAVA_OPTIONS="$JAVA_OPTIONS -Dfile.encoding=utf8"  in that file.


Thanks

Sanjeev

Kareem Wahba

thanks for your reply ... i searched for that file but i didn't find it

C:\Oracle\keemm\Middleware\Oracle_Home\wlserver\server\bin

is this the right path ?!

SanjeevChauhan

No. You need to check your domain location. If you are using Jdev to run application then domain will be under system directory. It is generally (if not changed by environment variable) is located under C:\Users\<yourusername>\AppData\Roaming\JDeveloper\<yoursystemdirectorybasedonjdev-version>/DefaultDomain/bin

Thanks

Sanjeev

Kareem Wahba

sorry i am too late to response and unfortuntly i faced serveral problems ,thanks for your reply but i am looking for that directory but i can't find it do you have any idea about how to find it?

Ajay Taneja

Hi Kareem,

If you are not able to find the path what you can do is that open jdeveloper and choose run-->start weblogic server.

Check your console window, it will show you your path where this file.

It should help you,

Cheers,Ajay

Kareem Wahba

thanks for your reply sir , i found it but it seems that folder "AppData" was hidden , but now i am trying to run this JAVA_OPTIONS="$JAVA_OPTIONS -Dfile.encoding=utf8"    but it didn't work what should i type in the cmd exactly ?

1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 20 2017
Added on May 23 2017
1 comment
963 views