Store Image in SQL Server using Java Netbeans(Update image)

Store Image in SQL Server using Java Netbeans(Update image)

Indra Subedi

6 лет назад

12,189 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Indra Subedi
Indra Subedi - 17.03.2018 16:03

Please change the code as follows:

public class Succes extends javax.swing.JFrame {
String gender;
String filename = null;
byte[] person_image;
public Succes() {
this.person_image = null;

initComponents();
show_user();

}

and in private void jTable_Display_UserMouseClicked(java.awt.event.MouseEvent evt)
write the code as follow for image:
byte[] img = (userList().get(i).getImage());
ImageIcon imageIcon = new ImageIcon(new ImageIcon(img).getImage().getScaledInstance(lbl_img.getWidth(),lbl_img.getHeight(),Image.SCALE_SMOOTH));
lbl_img.setIcon(imageIcon);
person_image=img;

Ответить
Mustafa Othman
Mustafa Othman - 25.05.2023 17:49

When modifying a person's data, such as his name or address, the person's photo is automatically deleted? What is the reason

Ответить
C-Cube Centre of Computer Education
C-Cube Centre of Computer Education - 22.11.2020 19:47

I watched all your videos on JDBC tutorial. Really appreciate your sincere effort. I have a request if you could kindly make a video on navigation of records using buttons like First , Last , Next and Previous then I think your series on JDBC tutorial would really be 100% complete and would be of great help to millions of people. So please make on navigate buttons on your current data fields that is id, address , gender , knowledge , subject and image.

Ответить
David Ardian Alim
David Ardian Alim - 16.07.2019 10:22

hey so i manage to use this code, but i can't update anything before i insert the image. This is strange tho if i want to update the subject only and not the image, i can't do that since it gives me error and it's not convenient. And after that the image just gone and the data is not updated, what should i do?

Ответить
Lama Gonpul
Lama Gonpul - 30.06.2019 22:50

I try updating the Address field as I’m receiving not null constrained failed for the image. How can I solve this

Ответить
Lama Gonpul
Lama Gonpul - 30.06.2019 22:39

I try updating the name field but they telling me that the image is null, and it’s not inserting. How can I solve this problem

Ответить
Jeyapal Vt
Jeyapal Vt - 21.08.2018 07:10

How to set clear or empty imagelable after insert data....

Ответить
Elio Kyomo
Elio Kyomo - 17.08.2018 16:26

@IndraSubedi I'm getting a ByteArrayOutputStream index out of bounds error! in the for loop (int readNum).

Ответить
Girly Frofunga
Girly Frofunga - 08.08.2018 11:00

what is the data type of your image in sql?

Ответить
Min Bogati
Min Bogati - 19.03.2018 16:42

Yes , its very helpful and useful for java developer.

Ответить
Akansha Joon
Akansha Joon - 15.11.2017 08:52

You know .net

Ответить