Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display hugeclob data on jtable  RSS feed

 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to run an sql query to display onto my jtable. However, i got this as a result:

oracle.sql.CLOB@11876a2

When I run the same SQL query on Toad i get the field hugeclob and one is then able to see whats inside the field. I want to basically either have a hugeclob on my jtable or perhaps to display on a textarea the data

Any help please?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's just what toString() of oracle.sql.CLOB objects return - the default implementation from java.lang.Object which is the class name, an @, and the hexadecimal representation of the hash code. You need to convert the CLOB into a String to render it properly.

I've seen that oracle.sql.CLOB implements java.sql.Clob, so you can use its methods. clob.getSubString(0, clob.length()) should give you the entire contents.
 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is currently the code which displays into the JTable. Just from the line below, how/what way could I add the ToString?


Or, should I be adding them individually as per how this web page explains?
http://docs.oracle.com/javase/tutorial/jdbc/basics/retrieving.html
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would go into that DbUtils class, look at the resultSetToTableModel method, and fix it so that it handles Clob in the way that Rob suggested.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!