Bazadan gelen seklin oxunmasi

Bazadan gelen seklin oxunmasi

try {
byte[] imageBytes;
Image image;
Class.forName("com.mysql.jdbc.Driver");
Connection cnn = DriverManager.getConnection("jdbc:mysql://localhost:3306/swing", "root", "admin");
PreparedStatement pst = cnn.prepareStatement("select * from swing.image where id=?");
pst.setInt(1, 1);
ResultSet rs = pst.executeQuery();
while (rs.next()) {
imageBytes = rs.getBytes(2);
// cercive jlabel bildirir
image = getToolkit().createImage(imageBytes).getScaledInstance(cercive.getWidth(),cercive.getHeight(), Image.SCALE_FAST);
ImageIcon icon = new ImageIcon(image);
cercive.setIcon(icon);
}
System.out.println("Emeliyyat ugurla bitdi");
} catch (Exception e) {
e.printStackTrace();
}

 

Şərh