Nope. Still the same ClassCastException. Checked adminguide.pdf, page 55: -------------------------------------- native-results: set to true to use cachable, scrollable, updatable JRun ResultSet implementation. Set to false to use the ResultSet returned by the underlying JDBC driver. --------------------------------------
We need to get the OracleCallableStatement, because we need the getCursor(...) method. How can we achieve that using JRun JDBC service? regards, Budi > -----Original Message----- > From: Theodore Zimmerman [mailto:[EMAIL PROTECTED]] > Sent: 01 August 2002 21:14 > To: JRun-Talk > Subject: RE: ClassCastException: jrun.sql.JRunResultSet > > > Budi, > Change <native-results>false</native-results> to > <native-results>true</native-results>. This will use > Oracle's driver and not JRun's implementation. > > HTH. > > Ted Zimmerman > > -----Original Message----- > From: Budi Prawira [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 31, 2002 10:43 PM > To: JRun-Talk > Subject: RE: ClassCastException: jrun.sql.JRunResultSet > > > Eric, > > This is what I did: > 1. setup a new data source. Below is the result (taken from > jrun-resources.xml): > -------------------------------------- > <data-source> > <dbname>M2M_TEST_DS</dbname> > <driver>oracle.jdbc.driver.OracleDriver</driver> > <url>jdbc:oracle:oci8:@isis</url> > <username>m2m</username> > <password>A573316D0B3B2DE9C3F46D8B6AB5D6D2</password> > <encrypted>true</encrypted> > > <encryption-class>jrun.security.JRunCrypterForTwofish</encrypt > ion-class> > <native-results>false</native-results> > <remove-on-exceptions>true</remove-on-exceptions> > <pool-statements>true</pool-statements> > <initial-connections>1</initial-connections> > <connection-timeout>1200</connection-timeout> > <transaction-timeout>20</transaction-timeout> > <cache-enabled>false</cache-enabled> > <cache-size>5</cache-size> > <cache-refresh-interval>30</cache-refresh-interval> > <jndi-name>M2M_TEST_DS</jndi-name> > <poolname>Pool</poolname> > <minimum-size>0</minimum-size> > <maximum-size>2147483647</maximum-size> > <user-timeout>20</user-timeout> > <skimmer-frequency>420</skimmer-frequency> > <shrink-by>5</shrink-by> > <maximum-soft>true</maximum-soft> > <debugging>false</debugging> > <disable-pooling>false</disable-pooling> > <description /> > </data-source> > -------------------------------------- > > 2. created a test jsp file: > -------------------------------------- > <% > try { > String jndiName = "M2M_TEST_DS"; > InitialContext _context = new InitialContext(); > DataSource ds = (DataSource) _context.lookup(jndiName); > // bind jndiName > // msg = ds.getClass().getName(); --> this one returns > "jrun.sql.JRunDataSource" > Connection conn = ds.getConnection(); > OracleCallableStatement ocs = (OracleCallableStatement) > conn.prepareCall("xxx"); > msg = ocs.getClass().getName(); > %> > msg = <%=msg%> > <% > } catch(Exception e) { > %> > <pre><%e.printStackTrace(new PrintWriter(out));%></pre> > <% > } > %> > -------------------------------------- > > . and this was the result: > -------------------------------------- > java.lang.ClassCastException: jrun.sql.JRunCallableStatement > at jrun__test12ejspa._jspService(jrun__test12ejspa.java:75) > at > jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43) > at jrun.jsp.JSPServlet.service(JSPServlet.java:106) > at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) > at > jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) > at > jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatche > r.java:241) > at > jrun.servlet.ServletEngineService.dispatch(ServletEngineServic > e.java:527) > at > jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) > at > jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(Th > readPool.java: > 348) > at > jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(Threa > dPool.java:451 > ) > at > jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(Thre > adPool.java:29 > 4) > at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) > -------------------------------------- > > Eric, did I make mistakes somewhere? > > regards, > > Budi > > > > > -----Original Message----- > > From: Eric Anderson [ <mailto:[EMAIL PROTECTED]> > mailto:[EMAIL PROTECTED]] > > Sent: 25 July 2002 19:17 > > To: JRun-Talk > > Subject: RE: ClassCastException: jrun.sql.JRunResultSet > > > > > > 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. > > > > > ______________________________________________________________________ Get the JRun Web Application Construction Kit - the only book written specifically for JRun developers. http://www.amazon.com/exec/obidos/ASIN/0789726009/houseoffusion Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
