This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Websphere and the fly likes How can I interact with OracleResultSet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "How can I interact with OracleResultSet?" Watch "How can I interact with OracleResultSet?" New topic

How can I interact with OracleResultSet?

Chris Delano

Joined: Jan 20, 2004
Posts: 6
My end goal is to call OracleResultSet specific methods in WebSphere 5.1.x

How can I do this in WebSphere? It appears that WebSphere wraps ResultSet objects with its own: WSJdbcResultSet

JBoss wraps ResultSet objects with "WrappedResultSet" and has a method called "getUnderlyingResultSet()" which I can call to obtain the OracleResultSet and thus call OracleResultSet specific methods.

But "WSJdbcResultSet" has no such method! That's nice!

I tried using WSCallHelper.jdbcCall() to call an OracleResultSet specific method and that didn't work either. I received an SQLException:
Invalid Caller Type:

But WSJdbcResultSet is the object wrapping the OracleResultSet on which I would like to call a method, so why would that be the invalid caller? Couldn't find any help on Google for that one.

So does anyone know how to obtain, or call methods on, the OracleResultSet object wrapped by WebSphere's WSJdbcResultSet object?

I looked around in the "JDBC Providers" section in the WebSphere admin console and couldn't find anywhere to configure WebSphere to basically not wrap the Oracle JDBC Driver classes with its own. Did I miss something?

Thanks a lot for any advice!

Tony Smith
Ranch Hand

Joined: Mar 15, 2005
Posts: 77
Can you just cast the result set to an OracleResultSet?
Chris Delano

Joined: Jan 20, 2004
Posts: 6
No, I wasn't able to cast the returned 'ResultSet' because the object implementing the ResultSet interface in this case is WebSphere's WSJdbcResultSet and this object wraps OracleResultSet so I received a ClassCastException in my first attempt to obtain OracleResultSet.

I finally found some help on 'da web' and ended up getting the connection from the connection pool and then called:

to obtain a reference to the OracleConnection and then I was able to get to the OracleResultSet and call its methods.

Here is the helpful link I found.

Hopefully this will help someone else.

Otherwise if someone thinks this is a potentially bad idea, please speak up!

Ceausu Catalin

Joined: Jun 04, 2008
Posts: 1
I know it is a very late response but maybe someone will find this usefull:
(It sets a BLOB)
Note that Hibernate session must be flushed before calling this code.

stmt = HibernateUtil.getSession().connection().createStatement();

String sqlText =
"SELECT pic_data " +
"FROM picture " +
"WHERE id=" + picture.getId() + " FOR UPDATE";
rset = stmt.executeQuery(sqlText);
boolean retnext =;

if ( retnext == false ) throw new Exception("picture row not found: " + picture.getId());

Object oraBLOB = WSCallHelper.jdbcCall(null, rset, "getBlob", new Object[] {new Integer(1)}, new Class[] {int.class});
logger.debug("WSCallHelper.jdbcCall returned:" + oraBLOB);

byte[] buffer = new byte[4096];

// avoid including oracle classes
Method mthd = oraBLOB.getClass().getMethod("getBinaryOutputStream", new Class[]{});
OutputStream outputStream = (OutputStream)mthd.invoke(oraBLOB, new Object[]{});

int length = -1;
while ((length = != -1) {
outputStream.write(buffer, 0, length);

I agree. Here's the link:
subject: How can I interact with OracleResultSet?
It's not a secret anymore!