Re: using BLOB objects and ...
- From: "Rhino" <no.offline.contact.please@xxxxxxxxxx>
- Date: Wed, 5 Jul 2006 15:54:07 -0400
"ali" <ali4ever4@xxxxxxxxx> wrote in message
news:1152071485.438705.228110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
thanks alot Rhino for your help you were really really so much helpfulYes, I understand your concerns about each of these possible approaches to
thanks alot for suggesting all of these options well
One other thing: what operating system(s) will be used for this system?we are using Windows XP
Most
databases are limited to only some of the operating systems that are
available.
for the options you suggested about MS Access well ok they do not fet
our needs because
1- saving them in the file will consume more time for getting them back
specially when we will develop a searching program that will search
them from the database
2- converting them to string of TFTF will need a convertion function
while saving the array object to the database which is ok but while
searching the database we will have to get each string of TFTF and
convert it back to object of 4 dimention boolean array which will be
overhead on the search
3- OLE may be usefull but still dont know any one have tried it before
so prefere not to use it
storing the data in Access.
I've done a little more research on this issue and have some further
information for you.
I posted to comp.lang.java.databases to see if there is ANY database that
will let you store your 4 dimensional boolean array in it. No one was able
to suggest any such database. Now, that doesn't mean that a database with
this capability doesn't exist! Perhaps several databases can do what you
want but no one who is familiar with those databases saw the question. Or
maybe those people were too busy to answer the question. So I can't say with
any certainty that there is no database that can directly store an array.
I also did some searches in the DB2 manuals since I am primarily a DB2 user.
I found some information but it wasn't very clear so I posted to
comp.databases.ibm-db2 to get clarifications. I was told there by one of the
people from the IBM lab where they develop DB2 (for Windows/Unix/Linux) that
DB2 Version 8 does not support direct storage of arrays. Also, it will not
support direct storage of arrays in Version 9, which will be out soon. They
suggested that best approach was to convert the boolean array into a byte
array; then it could be stored in a BLOB datatype (a VARCHAR FOR BIT DATA
would also be possible if the array were smaller than it is). Converting the
data to a byte array is a very standard approach and has been used for
several years for many kinds of data. For example, if you wanted to store a
JPEG in a DB2 database, you would first convert it to a byte array and then
store the byte array in a BLOB datatype.
In the case of MySQL, I think you will need to convert your boolean array to
a ByteArrayInputStream, then use setByteStream() to store the
ByteArrayInputStream in a BLOB datatype. When you retrieve the data later,
you will need to use getBlob() on the result set for your BLOB column. Then
you will need to convert the blob value back to a boolean array; I think you
will probably need to convert the blob to a byte array first, then convert
the byte array to a boolean array. Please note that I have never tried
exactly what you are doing and my suggestion is only that: I _think_ it is
the right approach but it may not work. You may have to modify my suggestion
a bit and use different intermediate datatypes to accomplish your goal.
I _have_ stored and retrieved JPEGs and audio files in MySQL with code
similar to what I suggested for your problem so if it would help you, I
could post some fragments of that code. But my code isn't converting a
boolean array to a byte array input stream or a byte array to a boolean
array so I suggest you do some Google Group searches to see if you can find
some existing examples of the techniques you'll need.
You're very welcome! Good luck with your project!
any how we have to submit a running programe the do this and save it in
any kind of dbms by saturday
since i just have experiance in MS Access , Oracle and MYSQL
so i think i will download MYSQL dbms and its driver and try this thing
thanks a lot for your help i just dont know how to thank you enough
--
Rhino
.
- Follow-Ups:
- Re: using BLOB objects and ...
- From: ali
- Re: using BLOB objects and ...
- References:
- using BLOB objects and ...
- From: ali
- Re: using BLOB objects and ...
- From: Rhino
- Re: using BLOB objects and ...
- From: ali
- Re: using BLOB objects and ...
- From: steve
- Re: using BLOB objects and ...
- From: ali
- Re: using BLOB objects and ...
- From: Rhino
- Re: using BLOB objects and ...
- From: ali
- using BLOB objects and ...
- Prev by Date: how to make ant ignore warning
- Next by Date: Re: Looking for programmers...
- Previous by thread: Re: using BLOB objects and ...
- Next by thread: Re: using BLOB objects and ...
- Index(es):
Relevant Pages
|