multithreading - how to increase the performance of the java application fetching a large data from oracle database? -
i have 3 database tables - items, audits , comments. have fetch large amount of data items table, 1 million records, , each item fetched, have retrive data audits , comments , write report delimited file. output may ,
item entry 1 audit entry 1 item 1 audit entry 2 item 1 audit entry 3 item 1 comment entry 1 item 1 comment entry 2 item 1 item entry 2 audit entry 1 item 2 . . .
now taking time, because program querying oracle 1 million times every item. increase performance thru threads i'm not familiar threads. me performance increase ?
you can write stored procedure output file utl_file package , call java. way can use like
f := utl_file.fopen('my_dir','my_file','w'); r_items in (select * items) loop utl_file.put_line(f,r_items.name); r_audit in (select * audit item_id = r_items.id) loop utl_file.put_line(f,r_audit.some_field); end loop; r_comments in (select * comments item_id = r_items.id) loop utl_file.put_line(f,r_comments.some_field); end loop; end loop;
Comments
Post a Comment