Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracel 10gR2 XMLDB -- how to query in Java

485455Mar 2 2006 — edited Mar 3 2006
I’ve some problems.
I’ve some search queries which are working on normal relation table, but I don’t know how it works on XMLDB (Oracle 10gR2)


Structure of XML file

My xml table structure will be :

Create table <tablename>
(
Person_Id number primary key,
Person_BankName varchar2,
DateOfEntry date,
Xmlcol xmltype
)

Xmlcol xmltype will be mapped to a schema for the below xml file.

XML File

<Person>
<Information>
<firstname>Suchendra</firstname>
<lastname>Kumar</lastname>
<middlename>Krishna</middlename>
</Information>
<Account>
<accountno>12212</accountno>
<balance>42323.89</balance>
<opendate>12-03-2005</opendate>
</Account>
<Transaction>
<transamount>1000</transamount>
<balance>41323.89</balance>
<trandate>14-03-2005</ trandate >
<trantime>10:40:22</trantime>
</ Transaction >
</Person>

SQL Queries Required
1. Query to fetch the records whose transaction has been done from date 12-03-2001 to date 01-01-2005.
2. Query to fetch the records whose lastname=”Kumar”
3. Query to fetch the records whose transaction has been done from time 9:09:55 to time12:26:23.
4. Query to fetch the records whose balance > 4000 and balance < 5000.
5. Regular expression Search in XMLDB. Ex: searching for records whose firstname has ‘su*’ in it.


How to extract these result set values in java for XMLDB (JDBC)?
How to fetch these values from the result set?
Whether Prepared Statement, Execute Query are compatible in XMLDB

Can anyone help me in this..

Thanks in advance
Athar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2006
Added on Mar 2 2006
1 comment
392 views