publicvoidvoltaImagem(){try{intnome=0;PreparedStatementps=db.prepareStatement("select * from images limit 500");ResultSetrs=ps.executeQuery();if(rs!=null){while(rs.next()){longtempo=System.currentTimeMillis();byte[]imgBytes=rs.getBytes(2);// use the bytes in some way hereByteInputStreamin=newByteInputStream(imgBytes,0);Imageimage=Toolkit.getDefaultToolkit().createImage(imgBytes);BufferedImagebi=newBufferedImage(320,240,BufferedImage.TYPE_INT_RGB);Graphics2Dg=bi.createGraphics();g.drawImage(image,0,0,null);g.dispose();Filefi=newFile("D:\\img_rec\\s"+nome+".jpg");ImageIO.write(toBufferedImage(image),"jpg",fi);nome++;longtempoAtual=System.currentTimeMillis()-tempo;System.out.println(tempoAtual);tempo=System.currentTimeMillis();}rs.close();}ps.close();}catch(Exceptione){e.printStackTrace();}}
W
webeverton
Cara… os imports?! quais são… acho q to ficando loko…
bom, consegui fazer funcionar o lance, porém, não resolveu meu problema… hehehehe
não consegui tirar as imagens do oracle(que foram cadastradas via delphi)…
vou tentar outra coisa…
valeu mesmo assim!
biozit
vc tem de ver se sua imagem não foi convertida em alguma coisa antes de ser inserida…
no meu caso fiz tudo em java…e foi tudo em byte mesmo
ja vi em alguns casos a imagem é convertido em octal
W
webeverton
hum… interessante… octal seria “8fy3209ghq109eu7f0923”? algo desse tipo?!
biozit
pode até ser viu…
mas é como nadar de olho fechado…
eu uso postgresql e tem o EMS que vc pode ver as imagens, ve se vc nun tem isso para o oracle