To read a CLOB or BLOB column using a stream
strSQL = "Select Xmlgen.getxml (' select * from Account_holder where id_no= ' 0001 ') from dual";
ResultSet rs=stmt.executequery (strSQL);
if (Rs.next ()) {
CLOB CLOB = ((Oracleresultset) RS). Getclob (1);
if (clob!=null) {
Reader is = Clob.getcharacterstream ();
BufferedReader br = new BufferedReader (IS);
String s = br.readline ();
while (S!=null) {
byte[] temp = s.getbytes ("iso-8859-1");
s = new String (temp);
Content = = s;
S=br.readline ();
}
}
}
OUT.PRINTLN (content);
Write content that is read from the database to a file
FileOutputStream fo = new FileOutputStream (xmlFile);
PrintStream so = new PrintStream (FO);
SO.PRINTLN (content);
So.close ();
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service