- Mar 8, 2003
- 38,416
- 4
- 0
Greetings,
I need to store 2D and 3D arrays of integers and floats (respectively) in a mysql database. Each of these arrays is associated with a single tuple. I assume that I would need to somehow serialize these things and store them as a blob.
Now, I am using Sun's mySQL C++ library for C++. The setBlob preparedstatement function accepts an istream.
My first thought was to play around with casting and memcpy to dump the bytes from the arrays into 1D character vectors and use the istringstream to istream to beam it up to that database, that failed.
Currently, I write all of the values to an EOL delimited text file and use an istream in the form of an ifstream to upload the contents, but that is very lame and I would like to bypass the writing to a file.
I was considering using pipes, but not sure if that was the best way to go about doing it either.
Any thoughts?
Oh, this is using the Sun Studio compiler in OpenSolaris, so BOOST and other mainstream libraries will not work.
I need to store 2D and 3D arrays of integers and floats (respectively) in a mysql database. Each of these arrays is associated with a single tuple. I assume that I would need to somehow serialize these things and store them as a blob.
Now, I am using Sun's mySQL C++ library for C++. The setBlob preparedstatement function accepts an istream.
My first thought was to play around with casting and memcpy to dump the bytes from the arrays into 1D character vectors and use the istringstream to istream to beam it up to that database, that failed.
Currently, I write all of the values to an EOL delimited text file and use an istream in the form of an ifstream to upload the contents, but that is very lame and I would like to bypass the writing to a file.
I was considering using pipes, but not sure if that was the best way to go about doing it either.
Any thoughts?
Oh, this is using the Sun Studio compiler in OpenSolaris, so BOOST and other mainstream libraries will not work.