Re: using BLOB objects and ...




"ali" <ali4ever4@xxxxxxxxx> wrote in message
news:1152071485.438705.228110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
thanks alot Rhino for your help you were really really so much helpful

thanks alot for suggesting all of these options well


One other thing: what operating system(s) will be used for this system?
Most
databases are limited to only some of the operating systems that are
available.
we are using Windows XP

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

Yes, I understand your concerns about each of these possible approaches to
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.


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

You're very welcome! Good luck with your project!

--
Rhino


.



Relevant Pages

  • Re: KirbyBase
    ... creating objects from the database records was much easier. ... Hal, I don't know if you have had a chance to take a look at the beta yet, but I basically tried to implement a uniform way to specify one-to-one links, one-to-many links, and calculated fields in the ... I suppose it would in effect be embedding an array where all the ... My first couple of attempts at adding more complexity to KirbyBase did not honor this concept. ...
    (comp.lang.ruby)
  • Re: KirbyBase
    ... I'm an Object Guy and Jamey is a Database Guy. ... That requires the table name and key field name to be specified ... I suppose it would in effect be embedding an array where all the ... that is) might compress by a factor of 10 or more. ...
    (comp.lang.ruby)
  • Re: using BLOB objects and ...
    ... - You could use Memo if you converted your boolean array into a text string. ... boolean array when you fetch it from the database. ... You might be able to put the whole array in an OLE Object, ...
    (comp.lang.java.programmer)
  • Re: Permutations - 8 columns
    ... Thanks Markos for your input. ... SQL driver to access the database, I will have to use the long way to ... > Dim TotalAccounts As Long, ... We declare and resize an array variable with the ...
    (microsoft.public.excel.programming)
  • Re: Permutations - 8 columns
    ... Thanks Markos for your input. ... SQL driver to access the database, I will have to use the long way to ... > Dim TotalAccounts As Long, ... We declare and resize an array variable with the ...
    (microsoft.public.excel.programming)

Quantcast