skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

▼
 
  • RSS
  • Twitter
Wednesday, September 19, 2012

Retrieving CLOB data using JSP

Posted by Admin at 4:02 AM – 0 comments
 

If one of the database fields is of CLOB datatype, and this field needs to be retrieved using JSP, then normal functions like getString(??) will not work. First, the length of the CLOB filed should be obtained and then getSubString() function is used to retrieve the CLOB data.



                     CLOB aclob = (CLOB)rset.getObject("column_name");
                  int clob_length = (int)aclob.length();
                  String data = aclob.getSubString(1, clob_length);

Leave a Reply

Newer Post Older Post
Subscribe to: Post Comments ( Atom )
  • Popular
  • Recent
  • Archives
Powered by Blogger.
 
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger