PROGRAMS
1. Develop a database
application to demonstrate storing and retrieving of BLOB and CLOB objects.
The document repository will use one
database containing one table to store its data. Using the MySQL console
application (c:\mysql\bin\mysql.exe for Win32 or /usr/bin/mysql for *nix
users), create the database and switch to it with the following commands:
create database myFiles;
use myFiles;
Next create the table that will actually store the BLOB's as part of the myFiles database:
create table myBlobs
Image credit |
blobId int auto_increment not null,
blobTitle varchar(50),
blobData longblob,
blobType varchar(50),
primary key(blobId),
unique id(blobId)
);
Now there is
one database named myFiles, which contains one table named myBlobs. The details
of each field in the myBlobs table are shown below:
·
blobId:
An integer that will provide a unique numerical identifier for each blob (ie 1,
2, 3, etc). It is incremented and tracked internally by MySQL whenever a new
record is added.
·
blobTitle:
A description of each blob in the table, for example "My word document
about golf", or "Picture of the sky". It serves no real purpose,
but will come in handy when viewing the files
through a web page later on.
The above is sample. Click on Download to get the complete
resources
DOWNLOAD
19:39 - By rajshekar t
8
8 comments: