Skip to Main Content

DevOps, CI/CD and Automation

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!

XSU and Connection Pool

56056Nov 22 2001
hi,

i am having a problem with XSU. I using the XSU to transform a
query to XML. Well, when i use the oracle.jdbc.driver, all works
fine, but when I try to use the websphere connection pool
configured with oracle Pool connection, it didn't? I only gets
blanks.

Examples:
1. It works fine
Driver driver=(Driver) Class.forName
("oracle.jdbc.driver.OracleDriver").newInstance();
Connection conn = driver.connect
("jdbc:oracle:thin:@10.10.10.10:1521:i2adw", lProps);
Statement stmt = conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rset = stmt.executeQuery("select domain_name,
fclty_name, item_name from fclty_item");
OracleXMLQuery qry = new OracleXMLQuery(conn, rset);
qry = new OracleXMLQuery(conn, rset);
qry.keepObjectOpen(true);
qry.setSkipRows(0);
qry.setMaxRows(10);
qry.useNullAttributeIndicator(true);
qry.setEncoding("ISO-8859-1");
String result = qry.getXMLString();

RESULT: <ROWSET>
<ROW num="1">
<ISCRNIDENTIFICATION>5</ISCRNIDENTIFICATION>
<ILNGNUMBER>0</ILNGNUMBER>
<IMSGNUMBER>2</IMSGNUMBER>
<CUSRNUMBER>501707790</CUSRNUMBER>
<DMSGDATE>07/11/2001 17:55:25</DMSGDATE>
<CMSGMESSAGE2> </CMSGMESSAGE2>
</ROW>

2. If i use this:
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup
("java:comp/env/" + connectionString);
conn = ds.getConnection();
Statement stmt = conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rset = stmt.executeQuery("select domain_name,
fclty_name, item_name from fclty_item");
OracleXMLQuery qry = new OracleXMLQuery(conn, rset);
qry = new OracleXMLQuery(conn, rset);
qry.keepObjectOpen(true);
qry.setSkipRows(0);
qry.setMaxRows(10);
qry.useNullAttributeIndicator(true);
qry.setEncoding("ISO-8859-1");
String result = qry.getXMLString();

I get:
<ROW num="1">
<TRANSP_RES_NAME NULL="YES"/>
<TRANSP_MODE_NAME NULL="YES"/>
<MAX_VOL_CAPC NULL="YES"/>
<MAX_WG_CAPC NULL="YES"/>
<MAX_PALLET_CAPC NULL="YES"/>
<RES_SIZE NULL="YES"/>
<LOAD_PLCY NULL="YES"/>
</ROW>
<ROW num="2">
<TRANSP_RES_NAME NULL="YES"/>
<TRANSP_MODE_NAME NULL="YES"/>
<MAX_VOL_CAPC NULL="YES"/>
<MAX_WG_CAPC NULL="YES"/>
<MAX_PALLET_CAPC NULL="YES"/>
<RES_SIZE NULL="YES"/>
<LOAD_PLCY NULL="YES"/>
</ROW>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2001
Added on Nov 22 2001
0 comments
117 views