I am implementing a MySql database, composed of many columns (doubles, strings etc.) and one BLOB variable which should be a ROOT file (TFile).
I would like to manage the writing and reading operations through ROOT classes (TSQLStatement).
No problem to deal with double/string, but I am encountering problems in using the TFile.
What is the best way to write and retrieve the TFile?
I could not find any example around.
Thank you in advance for any help you can provide.
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){
probably the best way to transform a TFile in a blob is to treat this entity as a normal file, e.g. w/o using the ROOT API, and stream it into the db.
Upon retrieval, two options are available:
Restore the file on disk, open it and proceed with some operations