This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Can I set a column value in ResultSet and return Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can I set a column value in ResultSet and return " Watch "Can I set a column value in ResultSet and return " New topic
Author

Can I set a column value in ResultSet and return

prash patil
Ranch Hand

Joined: May 26, 2008
Posts: 40
Hi All,

Can I modify the RESULTSET?
i.e. IF i Have one query Say
and It retuns me a column of type Clob.
If I want a String values instead of the Clob; then is it possible for me to get the same.

Thanks in advance.
PP
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

You can read the CLOB via an AsciiStream and store it in a string.

[edited to fix typo]


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Avyaya Avi
Greenhorn

Joined: Feb 04, 2009
Posts: 11
Patil, you can update the resultset and store the same in DB using ResultSet.updateXxxx() functionalities.

Or else, if you wish to store the clob values in a bean in a String form, you can do so by calling

someBean.setSisRec("ResultSet objects holding the column values");
 
Consider Paul's rocket mass heater.
 
subject: Can I set a column value in ResultSet and return
 
Similar Threads
lazy loading clob column
Converting a String to Clob for insert into DB
use of CLOB,help me.
Question on update CLOB column when the column value is null
How to register a Clob in the dataBase