• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

can I use xml to develop a database for a JSP based web portal??

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
can I use xml to develop a database for a JSP based web portal??
if so can anybody help me. I am new to XML
thanks a lot
Farooq
 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean by web portal? If you mean to create dynamic XML pages with JSP. Yes there probably is a way.
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Farooq Ali:

can I use xml to develop a database for a JSP based web portal??
if so can anybody help me. I am new to XML


Although there are XML databases, in general I don't think you would use XML to replace your database. The #1 application for XML in this context is to better separate data from its presentation (see also http://www.onjava.com/pub/a/onjava/2000/12/15/xslt_servlets.html )
- Peter
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Peter.
Although XML can be used to represent/transport data, whether you can use it as a "real" database depends on the robustness you want to achieve. There may be situations where using a real RDBMS would prove an overkill. So, the answer to your question is - evaluate!!

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a good rule of thumb, I design my XML and relational databases this way:
If I need to search data or aggregate it (perform computations across multiple records like sums or averages), I store it in a relational database. That's what relational databases are best at.
If I need to transform information into a different format for display purposes (to support both HTML and wireless devices, for example) or I need to transmit information across the Internet (to a business partner, perhaps) then I use XML. Those are two of the things that XML is good at.
- Kevin
------------------
Kevin Williams
Senior System Architect, Equient Corporation
author of: Professional XML Databases
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A hybrid system is also workable. Store your XML files in a RDB, with other fields in the same record containing key data extracted from the XML for searching/sorting purposes. This allows fast and effective retrieval of the right data, packaged as XML for easy transport and transformation.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay Kevin, I am not a DBA (so forgive me) and I have a question for you. On the performance side between a relational database, say Oracle 8i, and an xml document, if a transaction of an application is about I/O 4000 records/entries (I mean large in volumn), assuming no data manipulation (like update records), do you think the relational database performs better than a typical xml parser you find?
What I am getting at is the trade-off. My guess is the database should be faster, but I want to hear your opinion.
thanks
Colin
 
Kevin Williams
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank's right - I should have been more clear with what I said. In most instances, an indexed XML document store is the best way to go.
With regards to your question, Colin, it depends on the type of information you're trying to retrieve. If you are trying to select 4000 records out of a million, then a relational database would be the best way to go. On the other hand, if you have the 4000 records in one place (an XML document), it'll be easier to manipulate that document directly than it would be to call into a relational database to return the data. It all depends on the situation.
- Kevin
------------------
Kevin Williams
Senior System Architect, Equient Corporation
author of: Professional XML Databases
 
Farooq Ali
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everybody. specially kevin & frank for setting some facts straight. Actually I have no experience working on JSP/Servlets. I usually do Swing GUIs.
This is my first project I will most definitly keep you all busy with different question from time to time
again your help was very much appriciated
Farooq Ali
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question for Kevin?
I need to use java to receive XML data and write it to a DB2 database.
What I think I know:
-I will have to parse the XML into objects and use JDBC to write the data into the DB2 database.
What I know I don't know:
-Will my servlet and/or java application have to open the XML source file as a file object for i/o, or can the XML be passed into the servlet as content and then parsed into an object model for persistence to the database.
Any direction on this path or "Wake up call" (do it this way instead) would be appreciated. Also, if there are any links that anyone knows of that I can look at that will enlighten this task please let me know.
Thanks in advance
------------------
SCJP
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!