title: How to show an image from ms access to jpanel in java netbeans
body: <p>The code I've used:</p>
  
  <pre><code>private void okActionPerformed(java.awt.event.ActionEvent evt)        
  {                                   
      try {
          String Update = name.getText();
  
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection connection = DriverManager.getConnection("jdbc:odbc:NewPData");
          PreparedStatement psmnt = connection.prepareStatement("SELECT Image FROM Table1 where Name='" + Update + "'");
          ResultSet rs = psmnt.executeQuery();
          Blob blob = rs.getBlob("Image");
          int b;
          InputStream bis = rs.getBinaryStream("Image");
  
          FileOutputStream f = new FileOutputStream("Image.jpg");
          while ((b = bis.read()) &gt;= 0) {
              f.write(b);
          }
          f.close();
          bis.close();
  
          icon = new ImageIcon(blob.getBytes(1L, (int) blob.length()));
  
          lblImage.setIcon(icon);
  
      } catch (ClassNotFoundException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>The exception showed:</p>
  
  <pre><code>       java.lang.UnsupportedOperationException
  </code></pre>
  
  <p>I have first stored the image in ms access and now I want to show it on a label. Please help.</p>