Project Plan/Status for ODBC interface to CDF offline API The updated version of this document will reside at http://home.fnal.gov/~dbox/cdf/codegen.odbc.txt Original Draft: May 29 2003 Primary Goal: Working ODBC interface for calibration DB should work with oracle/mysql/postgres subject to idiosyncracies of the ODBC drivers and database servers. 4 packages affected DBObjects, CalibDB, (new)CodeGen (new) DBTemplates Secondary Goal: Make API that works with both OTL and ODBC to make HardwareDB TriggerDB et al more portable. - Easy enough w/ VecUtilOTL, make a VecUtilDB that 'knows' to go to ODBC or OTL. - More challenging, make an object which is as easy to use as otl_stream but knows how to default to otl or odbc. Ideally should be able to use otl_stream sql converting 'insert into foo values(:f1, :f2)' statements, which hardware and runconfigurations db are full of, into odbc like 'insert into foo values (?,?)' Work to be done on packages for Primary Goal: 1) DBObjects: a) Make DBObjects/odbc subdirs and makefiles (done, not checked pending 'turn on' of new codegen) b) Make two new objects ODBC_connection and ODBC_statement to simplify interaction w/ ODBC ODBC_connection does what you would guess connect(str) disconnect() ODBC_statement does i/o, has executeDirect(some_sql) prepareFetch(some_sql) fetchRow(some_vars) prepareInsert(some_sql) bindInsertVars(some_vars) insertRow(some_vars) (done) c) Make some test cases for DBObjects ODBC_connection done ODBC_statement works but not in DBObjects test case yet 2) CalibDB a) Make a ODBCDriverInfo to conserve symbols (stubbed in for compilation purposes) b) also: UsedSetODBC.cc RunListODBC.cc ValidSetODBC.cc get these to use ODBC_connection and ODBC_statement (partially done) 3) DBTemplates a) make all the necessary ODBC subdirectories, modify codegen makefiles so they find them and generate 'something' (done) b) modify as necessary until generated code compiles and does i/o correctly (started, not done) 4) Codegen: a) hand code a simple test case using ODBC_Connection, ODBCDriverInfo and other DBObjects and CalibDB objects b) get codegen to generate it - create AACodeGen/src/writer/odbcWriter.java and modify it until it generates what you want. (generated files fail to compile but fixing them seems straitforward) get it to do i/0 (Secondary Goal: VecUtilsOTL to VecUtilsDB) (not done) write a test case that could be made to work w/the following write a wrapper that works w/ OTL write a wrapper that works w/ ODBC (Secondary Goal: otl_stream to db_stream) (not done)