This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 30th, 2013  |  syntax: Java  |  size: 0.40 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Connection con = DriverManager.getConnection(connectionUrl);
  2. Statement s = con.createStatement();   
  3. resultset = s.executeQuery(query);
  4.  
  5. while (rs.next()) {
  6.  
  7.         byte[] imageInByte = resultset.getBytes("image");
  8.         InputStream in = new ByteArrayInputStream(imageInByte);
  9.         BufferedImage image = ImageIO.read(in);
  10.         //Что то делаем с картинкой и переходим к следующей
  11. }
clone this paste RAW Paste Data