Urgente!!!!Problemas al visualizar blobs en Firefo
Publicado por Ronald Lopez (12 intervenciones) el 10/02/2009 15:50:16
Hola muchachos, tengo un problema estoy trabajando con una aplicacion Web en java usado servlets y estoy consultando informacion de una base de datos Oracle 10g. En la base de datos tengo un campo de tipo blob el cual almcena archivos con extension pdf y .gif. Al abriri la aplicacion y traer este tipo de documentos desde internet Explorer la aplicacion funciona correctamente pero el problema lo tengo al querer abrirlo desde FireFox lo unico que me trae es un codigo ASCII y al final me genera el siguiente error :
Error 500: SRVE0199E: OutputStream already obtained
el codigo que estoy utilizandopara leer la informacion de la base de datos es el siguiente:
Blob blob = null;
String sql ="SELECT DOC_APLIC_BLOB FROM ARQUI_DOC_APLIC,ARQUI_TIPO_DOCU,ARQUI_APLICACIONES WHERE DOC_APLIC_COD_TIPODOC=2 AND APLIC_COD_APLIC=DOC_APLIC_COD_APLIC AND APLIC_COD_APLIC='"+id2+"'";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
System.out.println("Conexion Exitosamente1");
while (rs.next()){
blob = rs.getBlob("DOC_APLIC_BLOB");
InputStream is = blob.getBinaryStream();
OutputStream os = response.getOutputStream();
byte [] bytes = new byte[1024];
int n;
while ((n = is.read(bytes)) != -1) {
os.write(bytes, 0, n);
}
Por favor muchachos si tienen alguna sugerencia por fwvor respodan no he podio resolver este problema
Error 500: SRVE0199E: OutputStream already obtained
el codigo que estoy utilizandopara leer la informacion de la base de datos es el siguiente:
Blob blob = null;
String sql ="SELECT DOC_APLIC_BLOB FROM ARQUI_DOC_APLIC,ARQUI_TIPO_DOCU,ARQUI_APLICACIONES WHERE DOC_APLIC_COD_TIPODOC=2 AND APLIC_COD_APLIC=DOC_APLIC_COD_APLIC AND APLIC_COD_APLIC='"+id2+"'";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
System.out.println("Conexion Exitosamente1");
while (rs.next()){
blob = rs.getBlob("DOC_APLIC_BLOB");
InputStream is = blob.getBinaryStream();
OutputStream os = response.getOutputStream();
byte [] bytes = new byte[1024];
int n;
while ((n = is.read(bytes)) != -1) {
os.write(bytes, 0, n);
}
Por favor muchachos si tienen alguna sugerencia por fwvor respodan no he podio resolver este problema
Valora esta pregunta


0