Home | » | Java | » | Advance Java | » | Java Database | » | Insert Picture Into Table |
---|
The following is a simple Java program which will insert a picture into M.S. Access/SQL table. For this first of all you need to create a M.S.Access database or SQL... but in this example I'm using M.S.Access. Now you need create one table in M.S Access as shown below:
Table Definitions:
Column Definition:
Table Description:
|
After create table in M.S. Access database now you will create DSN.
Following is the source code of the InsertPicture.java
Now compile the above code using javac compiler and the run program.
C:\jdk1.4\bin javac InsertPicture.java
C:\jdk1.4\bin java InsertPicture
The above code will insert a "laura.jpg" named picture into img table.
Download Database
Good Post! Thank you so much for sharing the post, it was so good to read and useful to improve
ReplyDeleteJava Training in Electronic City