• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regarding clob (critical)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi group,
in weblogic server 6.1,in jdbc node i have created xxxpool connection.
java.sql.Driver XXXDriver = (java.sql.Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
con = XXXDriver.connect("jdbc:weblogic ool:xxxpool", null);
when i give these lines to open the connection,no problem ..i got the connection.
rs = stmt.executeQuery(somequerytoCLOB);
if (rs.next())
{
java.sql.Clob clob=rs.getClob(1);
java.io.Writer writer = ((oracle.sql.CLOB)clob).getCharacterOutputStream();
...
...
}
when i try to execute the above lines,no problem at all.
But instead of abv,
I have created one customdatasource in weblogic server 6.1 under jdbc node.
now to open the connection,
javax.naming.InitialContext ctx= new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("customdatasource");
con = ds.getConnection();
now i got the connection.After that when i try to execute these same lines mentioned abv,(for rs)
I get classcastException.
Exception is:
java.lang.ClassCastException: weblogic.jdbc.rmi.internal.OracleTClobImpl.
I dont't know how to solve this problem.
Can anybody help me to solve this critical problem.Otherwise i have to set any settings in
weblogic server for customdatasource.?
thank u...
---
Shalini.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using weblogic.jdbc.vendor.oracle.OracleThinClob. There is a BLOB example (basically the same thing) at the 3rd party drivers doc:
Oracle Thin Driver Extensions
 
shalinippriya
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dave Landers:
Try using weblogic.jdbc.vendor.oracle.OracleThinClob. There is a BLOB example (basically the same thing) at the 3rd party drivers doc:
Oracle Thin Driver Extensions


hi,
I have java.sql.* package.
And i have oracle.sql.* package.
so to solve the problem,i have to import weblogic.jdbc.vendor.oracle.OracleThinClob.
where i can find this package to import it in my class.And are u sure this is the only way to solve this problem using data source?
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
shalinippriya, Welcome to JavaRanch.
Please change your name to comply with the naming policy to which you agreed when you registered.
You can change your name here:
here

You can also find the naming policy here:
http://www.javaranch.com/name.jsp
Thank You!
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should be in weblogic.jar
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have <dbms-column-type> in your weblogic-cmp-rdbms.xml file specified for clob?
For example:
<field-map>
<cmp-field>rules</cmp-field>
<dbms-column>rules</dbms-column>
<dbms-column-type>OracleClob</dbms-column-type>
</field-map>
Usually the <dbms-column-type> is ommited but for clob and blob, without this it does not work in weblogic.

Originally posted by shalinippriya:
hi group,
in weblogic server 6.1,in jdbc node i have created xxxpool connection.
java.sql.Driver XXXDriver = (java.sql.Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
con = XXXDriver.connect("jdbc:weblogic ool:xxxpool", null);
when i give these lines to open the connection,no problem ..i got the connection.
rs = stmt.executeQuery(somequerytoCLOB);
if (rs.next())
{
java.sql.Clob clob=rs.getClob(1);
java.io.Writer writer = ((oracle.sql.CLOB)clob).getCharacterOutputStream();
...
...
}
when i try to execute the above lines,no problem at all.
But instead of abv,
I have created one customdatasource in weblogic server 6.1 under jdbc node.
now to open the connection,
javax.naming.InitialContext ctx= new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("customdatasource");
con = ds.getConnection();
now i got the connection.After that when i try to execute these same lines mentioned abv,(for rs)
I get classcastException.
Exception is:
java.lang.ClassCastException: weblogic.jdbc.rmi.internal.OracleTClobImpl.
I dont't know how to solve this problem.
Can anybody help me to solve this critical problem.Otherwise i have to set any settings in
weblogic server for customdatasource.?
thank u...
---
Shalini.

 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic