Foros del Web » Programación para mayores de 30 ;) » Java »

como guardar un texto en formato RTF en un campo CLOB o BLOB (Oracle) con Java??

Estas en el tema de como guardar un texto en formato RTF en un campo CLOB o BLOB (Oracle) con Java?? en el foro de Java en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 28/10/2015, 05:49
 
Fecha de Ingreso: octubre-2015
Mensajes: 1
Antigüedad: 8 años, 5 meses
Puntos: 0
como guardar un texto en formato RTF en un campo CLOB o BLOB (Oracle) con Java??

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???

Etiquetas: blob, campo, formato, oracle, rtf, string
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:24.