Hi.
The problem is that JBoss is using pool to store the result sets and wraps
all result sets in this ResultSetInPool...
That's when you are using Minerva only because Minerva does that actually
this caching...
The solution to this problem is the following :
OracleResultSet oracleResultSet;
if (rs instanceof org.opentools.minerva.jdbc.ResultSetInPool) {
// for jboss we have to get the real (encapsulated) ResultSet
oracleResultSet = (OracleResultSet)
((org.opentools.minerva.jdbc.ResultSetInPool) rs).getUnderlyingResultSet();
}
else {
oracleResultSet = (OracleResultSet) rs;
}
So u have to get the actual ResultSet which in this case is an
OracleResultSet by calling getUndelyingResultSet()....
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 26, 2001 11:49 AM
Subject: [JBoss-user] problem with oracle Clob column.
> hello jboss users.
> I want to write inside a Clob column in a oracle database. And I have
> problems with it. My code is this:
> -----------------------------------
> .
> .
> import oracle.sql.*;
> import oracle.jdbc.driver.*;
> .
> .
> con.setAutoCommit (false);
> Statement stmt = con.createStatement ();
> /*
> first,I insert into my table one record with only one blank space.
> */
> stmt.execute ("insert into mytable(mycol) values(' ')");
> /*
> second,I obtain my CLOB object and call fillClob, this is a method that
> write inside this object.
> */
> ResultSet rset = stmt.executeQuery ("select * from mytable for update");
> while (rset.next ())
> {
> CLOB clob = ((OracleResultSet)rset).getCLOB (1); /* #### this line
> cause the exception with pooling*/
> fillClob (con, clob, 6000);
> }
> rset.close();
> stmt.close();
> con.commit();
> con.setAutoCommit (true);
>
> ---------------------------------
>
> This is a modification of one example from
>
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.81
> 7/a83724/samapp4.htm#1000956
> (if you wish to see it and need password. Membership is free )
>
> This code is working fine if I obtain the Connection without using
> minerval or jboss conection pooling . But if I obtain this
> Connection with this pooling(I tried it with jboss 2.2.2 and beta
2.4 ).
> I obtain the next exception in line above mark with '###'
>
> java.lang.ClassCastException:
> org.opentools.minerva.jdbc.ResultSetInPool
>
>
> �Can I work with this objects (CLOB) with pooling ?
> thaks for your help.
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user