Buenos dias,
Estoy intentando guardar el siguiente contenido en formato RTF en un campo CLOB o BLOB (oracle) con Java:
\E\rtf1\E\adeflang1025\E\ansi\E\ansicpg1252\E\uc1\ E\adeff0\E\deff0\E\stshfdbch0\E\stshfloch37\E\stsh fhich37\E\stshfbi37\E\deflang1046\E\deflangfe1046\ E\
themelang1046\E\themelangfe0\E\themelangcs0{\E\fon ttbl{\E\f0\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}{\E\f0\E\
fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}\.br\{\E\f37\E\fbidi \E\fswiss\E\fcharset0\E\fprq2{\E\*\E\panose
020f0502020204030204}Calibri;}{\E\flomajor\E\f3150 0\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}\.br\{\E\fdbmajor\E\
f31501\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}{\E\fhimajor\E\f31502\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\
E\panose 02040503050406030204}Cambria;}\.br\{\E\fbimajor\E\ f31503\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}
{\E\flominor\E\f31504\E\fbidi \E\froman\E\fcharset0\E\fprq2{\E\*\E\panose 02020603050405020304}Times New Roman;}.... <continua en el arquivo txt adjunto>
Realize una función para convertir de String para Clob pero no esta funcionando correctamente:
public static CLOB getCLOB( String clobData ){
CLOB tempClob = null;
try {
tempClob = new CLOB((oracle.jdbc.OracleConnection)dbConnection,cl obData.getBytes());
} catch (Exception exp) {
System.out.println("erro"+exp);
}
return tempClob;
}
y luego realizo el insert en la tabla:
public void insert(String Id, String patientId, String instituteId, String orderAccessionNumber, String staffMemberVerified, String staffMemberDictated, String reportApprovalDate, String medicalReport, String controlDate ) {
String insert = "insert into " + tableName + " (ID, PID_ID, UNIDADE_ID, OBR_ACCESSION_NUMBER, OBR_PRINCIPAL_RESULT_INTERP, OBR_ASSISTANT_RESULT_INTERP, OBR_RESULT_DATE, CTRL_DATE, CTRL_STATUS, DATA_INTEGRACAO, DS_ERRO_INTEGRACAO, TST_OBX_OBSERVATION_VALUE,OBX_OBSERVATION_VALUE) values (DBASIH.seq_report_data.Nextval,'"+patientId+"', '"+instituteId+"', '"+orderAccessionNumber+"', '"+staffMemberVerified+"', '"+staffMemberDictated+"', sysdate, sysdate, 'N','','','','"+getCLOB(medicalReport)+"') ";
SimpleLog.print("Insert report:");
SimpleLog.print("orderIdPK:" +patientId);
SimpleLog.print("orderId:" +orderAccessionNumber);
SimpleLog.print("insert: " + insert);
Existe otra forma de realizar esto, algun ejemplo que me pueda ayuda???