http://stackoverflow.com/questions/1071120/how-do-i-use-mysql-c-connector-for-storing-binary-data
You have to subclass streambuf e.g. like this:
class DataBuf : public streambuf
{
public:
DataBuf(char * d, size_t s) {
setg(d, d, d + s);
}
};
Then you can instantiate an istream object which uses a DataBuf as buffer, which itself uses your block of binary data. Supposing that binarySize specifies the size of your binary data in bytes (sizeof(char) should be one byte), you could do this like so:
DataBuf buffer((char*)address, binarySize);
istream stream(&buffer);
That istream object you can now pass to setBlob().
Regards, Elrohir