Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert picture in MySQL using Netbeans 5.5

807600Jul 8 2007 — edited Jul 8 2007
Can 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2007
Added on Jul 8 2007
1 comment
177 views