2006-06-28

 

Usage of CLOB

public String generatePaymentNotice(String pEmail_status, String pInclude_header_ind) throws Exception {
Vector lvParaValue = new Vector();
String lvSQL = "select pkg_cg_enrolment.Sf_Cg_Gen_Payment_Notice(?,?,?,?,?) as result from dual";
lvParaValue.add(this.getYear());
lvParaValue.add(this.getOrg_id().toUpperCase());
lvParaValue.add(this.getOrg_name());
lvParaValue.add(pEmail_status);
lvParaValue.add(pInclude_header_ind);
ResultSet lvRs = db.executeSelect(lvSQL, lvParaValue);
// CHING. use oracle.sql.CLOB instead of java.sql.Clob for WebSphere Deployment.
// java.sql.Clob tempClob = null;
oracle.sql.CLOB tempClob = null;
if (lvRs != null && lvRs.next()) {
tempClob = (oracle.sql.CLOB) lvRs.getObject("result");
}
lvRs.close();
if (tempClob.length() > 1) {
sun.io.CharToByteConverter
fromUnicode = sun.io.CharToByteConverter.getConverter("Big5");
return new String(fromUnicode.convertAll(tempClob.getSubString(1 , (int) tempClob.length()).toCharArray()));
} else {
return "";
}
}

This page is powered by Blogger. Isn't yours?