[b]Saudações caros…
Estou com o seguinte problema… Estou com um arquivo(Planilha) armazenado no banco(tipo blob) que é chamado dentro do sistema, só que não está salvando os dados ao ser preenchido. Segue abaixo um trecho do código para ser avaliado!!! [/b]
byte[] fileBArray = new byte[(int) file.length()];
try {
fis = new FileInputStream(file);
}
catch (FileNotFoundException ex) {
Logger.getLogger(GridControlLSE.class.getName()).log(Level.SEVERE, null, ex);
}
try {
fis.read(fileBArray);
}
catch (IOException ex) {
Logger.getLogger(GridControlLSE.class.getName()).log(Level.SEVERE, null, ex);
}
vo = (LseVO) lseFrame.gridControl().getVOListTableModel().getObjectForRow(rowNumber);
vo.setLsedoc(fileBArray);
PreparedStatement stmt;
if(file.exists()){
try {
fis.close();
file.delete();
} catch (IOException ex) {
Logger.getLogger(GridControlLSE.class.getName()).log(Level.SEVERE, null, ex);
}
//file.deleteOnExit();
}
try {
stmt = conn.prepareStatement("UPDATE LSE SET LSEDOC = ?"
+ " WHERE PESSOAID='" + vo.getPessoaid() + "'"
+ " AND SOLID ='" + vo.getSolid() + "'");
stmt.setBlob(1,(Blob) new ByteArrayInputStream(vo.getLsedoc()));
stmt.execute();
conn.commit();
} catch (SQLException ex) {
Logger.getLogger(GridControlLSE.class.getName()).log(Level.SEVERE, null, ex);
}