Hi , I knwo jAXB is an option which is more efficient and use to use as well.But someone asked me to use JDBC.So is it possible to read XML file using JDBC driver. If yes how can it be done ?
There are products like Sunopsis XML Driver which do this. Personally I don't see the benefit - the big "benefit" seems to be the ability to query a document with SQL. Don't know why you might want to do this, since XPath is not too difficult to get to grips with.
Saurabh Agrawal
Ranch Hand
Joined: Oct 07, 2003
Posts: 238
posted
0
Thanks a ton for your reply.But Sunopsis XML Driver is a paid one and i am looking for some free ware.
Morever i wanna use it with my JBOSS.I.e. i dont want to open an input stream and simply want to do it with my J2EE container.
So i create a service and specify the driver JDBC to read a file for me.
Sunopsis is the only one I know about. I can see why you might need JDBC if by "i wanna use it with my JBOSS" you mean you want to parse this XML from an EJB and can't use file IO. In which case why don't you either store the XML in the DB, or use a JCA adapter for file system access?
Saurabh Agrawal
Ranch Hand
Joined: Oct 07, 2003
Posts: 238
posted
0
I guess JCA adapter needs us to specify the JDBC driver which we would need ? Am i rite at it? Anyways You were right at what i am trying to do .
why don't you either store the XML in the DB, or use a JCA adapter for file system access?
If a file can be saved in all kinds of databases?( I just know of ORACLE in this context). I asked this question because in case while developing the project, one doesn't know what database might be used in future.
To use JCA adapter for reading a file (while taking it as a datasource), we need to specify the jdbc driver class in xxx-ds.xml.
or
if we don't use jdbc driver then I suppose we have to write the implemenation code for JCA resource adabtor to read/write xml file.
If we write JCA resource adabtor then how do we configure it in xxx-ds.xml file?
If a file can be saved in all kinds of databases?( I just know of ORACLE in this context). I asked this question because in case while developing the project, one doesn't know what database might be used in future.
I'd hope so, though I can't say for sure. Every RDBMS I've used can support CLOBS or BLOBs etc. (or LONG RAW on older Oracle versions). But I wouldn't claim to know about all possible DBs so I suggest you do some checking if you are concerned.
To use JCA adapter for reading a file (while taking it as a datasource), we need to specify the jdbc driver class in xxx-ds.xml.
You need to specify a "driver" - but would be a driver for the resource you are trying to access, so its not a JDBC driver it would be some kind of File System resource adapter.
if we don't use jdbc driver then I suppose we have to write the implemenation code for JCA resource adapter to read/write xml file.
Yes. Or do some Googling for one that someone else has written. I can't think of one off the top of my head.
If we write JCA resource adabtor then how do we configure it in xxx-ds.xml file?