When you configure a JDBC data source in JRun 4 you have the option of classifying it 
as a "native" result set or a non-native" result set.  Native result sets return a 
JRunResultSet that allows the use of cacheable, scrollable and updateable result set.  
If you use a non-native result set you are returned a result set of the underlying 
JDBC driver.  If you are using the DataDirect driver and try to caste a DataDirect 
result set as a OracleResult set this could cause your problem.  

There are a couple of things you can do to work around this behavior.  First, (as Budi 
mentions) bind an data source in JNDI using the Oracle JDBC driver or Oracle 
connection pool.  Note, if any connection pooling was being implemented here it would 
be Oracle's connection pooling not JRun's.  This has the effect of only being able to 
return an OracleResult set since the DataDirect driver is not being used.  Second, try 
using the Oracle JDBC driver with the JRun connection pool (not the DataDirect driver 
that we ship with JRun 4).  If you do this you will want to set the XML descriptor 
<native-results>false</native-results> in the jrun-resources.xml.  This will make sure 
you are returning an OracleResult set from the Oracle JDBC driver.  Lastly, you could 
modify your JDBC code so that you 
do not caste the result set as an OracleResult set.

Post back to the list and let us know if this helps.

Thanks

Eric

JRun Support
Macromedia Inc.



-----Original Message-----
From: Budi Prawira [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 24, 2002 10:13 PM
To: JRun-Talk
Subject: RE: ClassCastException: jrun.sql.JRunResultSet


This is also another issue in using JRun 4. JRun JDBC driver wraps the real
JDBC driver. I don't know if there is a method in the wrapper that returns
the real object. Our workaround is to programatically bind the
OracleConnectionPoolDataSource to the Naming Service. So, we do not setup
JDBC data source in the JMC.

HTH,
Budi

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 25 July 2002 02:48
> To: JRun-Talk
> Subject: ClassCastException: jrun.sql.JRunResultSet
> 
> 
> In the below given code, I am keep getting -ClassCastException:
> jrun.sql.JRunResultSet - at line 8.
> Can anybody suggest why is it throwing?
> 
> 
> 1)    String query = "SELECT XML_DATA FROM ADVT_XML WHERE
> XML_NAME='TOOLS_XML' for update";
> 3)    Connection conn = ConnectionFactory.getConnection();
> 4)    conn.setAutoCommit(false);
> 5)    PreparedStatement statement = conn.prepareStatement(query);
> 6)    ResultSet rs = (ResultSet)statement.executeQuery();
> 7)    rs.next();
> 8)    CLOB clob = ((OracleResultSet)rs).getCLOB("XML_DATA");
> 9)    OutputStream out = clob.getAsciiOutputStream();
> 
> Thanks


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to