• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

xml creation from db

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a web application in j2ee. we r having problem in accessing 1000s of data from the oracle 9i db from our application.

The problem is in generating report from the application===> This is nothing but generating an xml file from the application and an xslt file which accepts input as the generated xml file. Cocoon accepts the xslt file and gives the output as html or pdf reports.

Now the problem is while generating xml file. The xml is getting created by using 8 queries from the database. In the previous code what was done is like writing each result of the query into lists and picking one by one data and writing it into a file using writeBytes. Hence while generating for huge amount of data it is getting stucked in between and the cpu takes 100% usage.
Now We made some changes in the code that we created one Document(DOM concept) and added the result of each query into the parent node. (The query is like nested loop ie the result should be appended in between the first query.... ). When generating the xml file for huge data(for less data working fine) we r getting an exception as "java.sql.SQLException: ORA-01000: maximum open cursors exceeded". Then we tried with only one prepared statement and one resultset and after that we have tried with "CachedRowSet" (new feature in jdk1.5 which closes the result set after executing query), then tried with increasing the number of open_cursors in oracle.
The code vl look like below
execute prepare statement(query1)

while(resultset1){

create element

add data to that element

appnd to parent

execute prepare statement(query2)

while(resultset2){

create element

add data to that element

appnd to parent

execute prepare statement(query2)

...

...

...

}

}



We came to know that there is another methed XSU(Xml Sql Utility(Coming with oracle) which directly generates xml string.. but not in the proper order)
Plz help me by giving a proper methed or way to solve this problum... Or Can we solve this with XSU ...

Also plz tell me abt anyother methed that we can follow to solve this problum.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not post the same question in multiple forums. It causes confusion and duplication of effort as the community tries to help everyone.
 
Create symphonies in seed and soil. For this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic