Insert picture in MySQL using Netbeans 5.5
807600Jul 8 2007 — edited Jul 8 2007Can anyone help me how to insert a picture in MySQL database by using Netbeans 5.5?
I understand that we need to use BLOB as the data type, but how to make MySQL read the location of the picture?
As an example, in table cars,
I have set the datatype VARCHAR for carid, name, vendor and type.
While for pic, I selected BLOB as its datatype.
How I insert data into the table?
I choose Execute Command at carid(primary key) and enter the information.
insert into cars (carid, name, vendor, type,pic) values ('N1','Skyline GT-R','Nissan','4WD',C:\\Documents and Settings\\My Document\\car1.jpeg)
However, I got wrong in term of assigning the value for pic. What should I do?
Please help me.
Thank you in advance.