Hello Danilo,
Thanks a lot for your answer.
My question was about how I can write a TFile to the database as binary data (BLOB) and how I can, from the database, retrieve a TFile from a binary value.
I found this discussion: [url]Problem retrieve a longblob from a mysql db
Here the code I tried to use, just to explain you better my question:
[code]
TSQLStatement* stmt = serv->Statement(ss.str().c_str(), 4000);
if (stmt->Process()) {
stmt->StoreResult();
if (stmt->GetNumFields()>0){
while (stmt->NextResultRow()) {
unsigned char* blob = 0;
Long_t blobSize;
stmt->GetBinary(9, (void*&) blob, blobSize);
TMessage mess;
mess.SetBuffer(blob, blobSize, kFALSE);
mess.SetReadMode();
mess.Reset();
TFile* m= (TFile*)(mess.ReadObjectAny(TFile::Class()));
}
}
}
[/code]
Thanks,
Edoardo