[ROOT] SQL Binary Inserts

From: Stephen A. Fuqua (sfuqua@dell12.hep.utexas.edu)
Date: Mon Oct 09 2000 - 19:08:10 MEST


Good morning from finally-its-not-bloody-hot-Texas,

The goal: I need to upload binary data (equivalent to a .root file
containing histogram objects) to a MySQL database from Root.

The problem: the only "native" way that I can find for invoking the SQL
"insert" command is through TSQLServer::Query(const char* sql) method.
Unfortunately, the argument for this method is a char*, and as far as I
am aware I cannot blithely cast a binary buffer to char* and use
strcat() to stuff it into 'sql'. Thus I need to find an alternative
method.

What would be ideal is a separate insert method, say TSQLInsert, that
could accept a binary buffer stream as an argument. I am aware of the
RDBC classes that Valeriy Onuchin has put together. It does something
like this, but operates through a middle JDBC layer. Thus I have two
questions to pose:

1) Has anyone else put together a class (or set of) like the proposed
TSQLInsert, that does not require a separate middle layer?

2) Has anyone used this RDBC package? If so, can you tell me something
about the performance? I've never used ODBC in a CPU-critical
environment before, so I've never had to benchmark it. Is there much
overhead in the transaction if I'm uploading binary data in this way?
Let's assume that the binary data is on the order of 1 MB and the JDBC
and MySQL are running on a machine that is also constantly analyzing
data, though we're not talking major number crunching.


Stephen A. Fuqua

sfuqua@hep.utexas.edu // High Energy Physics Lab
Research Assistant   // University of Texas at Austin
ph: 512.475.8673    // http://www.hep.utexas.edu/~sfuqua



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET