How to know the Multi-Value & Sub-Value position of the data when extracted using JDBC

1,683 views
Skip to first unread message

Samith Bulathgama

unread,
Oct 16, 2011, 12:45:29 PM10/16/11
to jb...@googlegroups.com

Dear All,


I’m doing some basic tests with JDBC connections with jBase (TAFC Major 09.0 , Minor 0.0 on Red Hat Enterprise Linux Server release 5.5,  jDK 1.6).


Given below is the java code to extract the F_BATCH table which works fine. The question for me is how to differentiate the relative Multi values & sub values within the record.


Eg. I need to know the multi value & sub value position of the extracted record like below.


RECORD<6,6> = ‘EB.PRINT’

RECORD<11,6,1> = ‘ENQ COMP.D.DAILY

RECORD<11,6,2> = ‘ENQ COMP.D.DIETZ

 

How I can do this mapping with the data received from the JDBC connection.


Java Code :


            stat = cx.createStatement();

            ResultSet rs = stat.executeQuery("SELECT BATCH_PROCESS,JOB_NAME, K_DATA FROM F_BATCH_JBL");

 

            //Obtain the meta data associated to the result set to print the no. of columns

            ResultSetMetaData rsMetaData = rs.getMetaData();

            System.out.println("Number of columns: " + rsMetaData.getColumnCount());

 

            //Fetch all rows and display the first column           

           

            while(rs.next()) {

            System.out.println("Record : " + rs.getString("BATCH_PROCESS") + "  - Job Name: " + rs.getString("JOB_NAME") + "   - Data : " + rs.getString("K_DATA"));

 

Full view of the actual record:

 

     BATCH PROCESS..... SG1/AM.COMP.BATCH

 ------------------------------------------------------------------------------

   6. 1 JOB.NAME....... AM.COMP.HIST.DET.UPD

   6. 2 JOB.NAME....... AM.COMP.HIST.UPD

  12. 2 JOB.STATUS..... 0                   READY

   6. 3 JOB.NAME....... AM.COMP.HIST.UPD.POST

   6. 4 JOB.NAME....... AM.COMP.YLY.UPD

   6. 5 JOB.NAME....... AM.COMP.YLY.UPD.POST

   6. 6 JOB.NAME....... EB.PRINT

  11. 6. 1 DATA........ ENQ COMP.D.DAILY

  11. 6. 2 DATA........ ENQ COMP.D.DIETZ

   6. 7 JOB.NAME....... EB.PRINT

  11. 7. 1 DATA........ ENQ COMP.HM.DAILY

  11. 7. 2 DATA........ ENQ COMP.HM.DIETZ

 

Output of the program :

 

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.DET.UPD  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.HIST.UPD.POST  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: AM.COMP.YLY.UPD.POST  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.HM.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data :

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.D.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.D.DIETZ

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.HM.DAILY

Record : SG1/AM.COMP.BATCH  - Job Name: EB.PRINT  - Data : ENQ COMP.HM.DIETZ

 

Thanks for the Help.

 

Best regards,

Samith

pat

unread,
Oct 18, 2011, 3:26:28 PM10/18/11
to jBASE
Easiest way to observe the mapping, would be to put 'meaningful' data
in a 'record'

Eg :

F_BATCH_JBL testrecord

006 Attr6_mv1]Attr6_mv2
...
...
011 Attr11_mv1_sv1\Attr11_mv1_sv2]Attr11_mv2_sv1\Attr11_mv2_sv2 etc

[ where ']' are Multivalue marks, and '\' are Subvalue marks ]

Then, using the output for the above record, you should be able to
observe the 'order' these fields are extracted / displayed, from which
you should be able to implement a method of determining the 'general
case' 'mapping'

Samith Bulathgama

unread,
Oct 19, 2011, 3:45:25 AM10/19/11
to jb...@googlegroups.com
Thanks Pat,
 
Which means, there is no straight forward technic available to identify the relative multivalue (& subvalue) positions once extracted the jBase data through JDBC..?
Best regards,
Samith

 
--
Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24

To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

VK

unread,
Oct 24, 2011, 3:17:36 AM10/24/11
to jBASE
Hi,
just my 2 cents.

If you're on Java path, why not use jRemote?

VK

tjondro utomo

unread,
Oct 25, 2011, 12:23:55 AM10/25/11
to jb...@googlegroups.com
Looks like very interesting to connect t24 using jRemote.
Dear VK, do you have any ebook about that topic ? Or maybe do you have any small user guide to accessing t24 using jRemote in java.

Best Regard,
Tj

VK

unread,
Oct 25, 2011, 9:49:22 AM10/25/11
to jBASE
Hi,

see {TAFC_home_dir}\man\jremote.chm

there are also some samples in ebook announced here:

http://groups.google.com/group/jbase/browse_thread/thread/38783e7dada75a54

... and see the link to another book at the very end of that one...

VK

Samith Bulathgama

unread,
Oct 25, 2011, 1:51:16 PM10/25/11
to jb...@googlegroups.com
Thank for this VK. Any idea about the performance between two methods, when we extract large number of records.

----------------------

Best Regards,
Samith

Sent from my mobile device

VK

unread,
Oct 26, 2011, 2:52:07 AM10/26/11
to jBASE
Hi,
sorry no idea about performance. Also, I never used jdbc. But if you
give more detail about the task in general - maybe you'll get more
advices regarding possible data retrieval methods.

VK

Samith Bulathgama

unread,
Oct 26, 2011, 11:38:50 AM10/26/11
to jb...@googlegroups.com
Thanks VK,

I'm trying to extract the data from jBase database & upload them to an
oracle database (after formatting) . The table can be any table within the
jBase & I should be able to handle a volume like couple of millions (say 10
million or more, but not always) records from jBase. This is the reason I
was checking for the performance.

As I understand the available methods for me are,

1. Using a Basic routine
2. Through JDBC connection
3. Using jRemote as you mentioned.

Any suggestions will help.

Best Regards,
Samith

VK

unread,
Oct 27, 2011, 2:46:22 AM10/27/11
to jBASE
Hi,
sort of DWH thing? I believe basic routine pushing data might be the
simplest choice. Even if you're doing 10 millions of records, it
shouldn't be that much. Incremental upload will make it even faster
(if applicable). Not sure about the format that Oracle understands but
probably something like csv might work.

Once upon a time Temenos had a module in Globus which did exactly that
- extracted data, normalized it and prepared sql statements to be put
to Oracle.

VK

Igor Micev

unread,
Oct 27, 2011, 4:27:12 PM10/27/11
to jBASE
Hi,
If it suits to you to extract a T24 table into one Oracle table then
you should use XML type columns in the Oracle table.
You can easily extract the data from T24 into a flat file. For the
multivalue fields you could represent the data as XML tree. The data
upload into a relational
database is very fast. Even with such Extracted data, you don't need
more than one table, and normalized SQL statements or so, because you
have a table with XML type variable in which you'll hold your
multivalue fields' data - represented as XML tree data structure.

The 'harder' way afterwards is the SQL queries' design, where you'll
have to use XQuery for the XML columns.

Kind regards
-Igor Micev
Reply all
Reply to author
Forward
0 new messages