TBufferSQL.cxx

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TBufferSQL.cxx 35977 2010-10-01 09:46:21Z pcanal $
00002 // Author: Philippe Canal and al. 08/2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 // TBufferSQL                                                           //
00015 //                                                                      //
00016 // Implement TBuffer for a SQL backend                                  //
00017 //                                                                      //
00018 //////////////////////////////////////////////////////////////////////////
00019 
00020 #include <stdio.h>
00021 #include "Riostream.h"
00022 #include "TError.h"
00023 
00024 #include "TBasketSQL.h"
00025 #include "TBufferSQL.h"
00026 #include "TSQLResult.h"
00027 #include "TSQLRow.h"
00028 #include <stdlib.h>
00029 
00030 ClassImp(TBufferSQL);
00031 
00032 //________________________________________________________________________
00033 TBufferSQL::TBufferSQL(TBuffer::EMode mode, vector<Int_t> *vc, 
00034                        TString *insert_query, TSQLRow ** r) : 
00035    TBufferFile(mode),
00036    fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r) 
00037 {
00038    // Constructor.
00039 
00040    fIter = fColumnVec->begin();
00041 }
00042 
00043 //________________________________________________________________________
00044 TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, vector<Int_t> *vc, 
00045                        TString *insert_query, TSQLRow ** r) : 
00046    TBufferFile(mode,bufsiz), 
00047    fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r) 
00048 {
00049    // Constructor.
00050 
00051    fIter = fColumnVec->begin();
00052 }
00053 
00054 //________________________________________________________________________
00055 TBufferSQL::TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, vector<Int_t> *vc, 
00056                        TString *insert_query, TSQLRow ** r,
00057                        void *buf, Bool_t adopt) : 
00058    TBufferFile(mode,bufsiz,buf,adopt),
00059    fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r) 
00060 {
00061    // Constructor.
00062 
00063    fIter = fColumnVec->begin();
00064 }
00065 
00066 //________________________________________________________________________
00067 TBufferSQL::TBufferSQL() : TBufferFile(), fColumnVec(0),fInsertQuery(0),fRowPtr(0)
00068 {
00069    // Constructor.
00070 
00071 }
00072 
00073 //________________________________________________________________________
00074 TBufferSQL::~TBufferSQL() 
00075 {
00076    // Destructo.
00077 
00078    delete fColumnVec;
00079 }
00080 
00081 //________________________________________________________________________
00082 void TBufferSQL::ReadBool(Bool_t &b) 
00083 {
00084    // Operator>>
00085 
00086    b = (Bool_t)atoi((*fRowPtr)->GetField(*fIter));
00087    
00088    if (fIter != fColumnVec->end()) ++fIter;
00089 }
00090 
00091 //________________________________________________________________________
00092 void TBufferSQL::ReadChar(Char_t &c)
00093 {
00094    // Operator>>
00095 
00096    c = (Char_t)atoi((*fRowPtr)->GetField(*fIter));
00097    
00098    if (fIter != fColumnVec->end()) ++fIter;
00099 }
00100 
00101 //________________________________________________________________________
00102 void TBufferSQL::ReadShort(Short_t &h)
00103 {
00104    // Operator>>
00105 
00106    h = (Short_t)atoi((*fRowPtr)->GetField(*fIter));
00107    
00108    if (fIter != fColumnVec->end()) ++fIter;
00109 }
00110 
00111 //________________________________________________________________________
00112 void TBufferSQL::ReadInt(Int_t &i)
00113 {
00114    // Operator>>
00115 
00116    i = atoi((*fRowPtr)->GetField(*fIter));
00117 
00118    if (fIter != fColumnVec->end()) ++fIter;
00119 }
00120 
00121 //________________________________________________________________________
00122 void TBufferSQL::ReadFloat(Float_t &f)
00123 {
00124    // Operator>>
00125 
00126    f = atof((*fRowPtr)->GetField(*fIter));
00127    
00128    if (fIter != fColumnVec->end()) ++fIter;
00129 }
00130 
00131 //________________________________________________________________________
00132 void TBufferSQL::ReadLong(Long_t &l)
00133 {
00134    // Operator>>
00135 
00136    l = atol((*fRowPtr)->GetField(*fIter));
00137    
00138    if (fIter != fColumnVec->end()) ++fIter;
00139 }
00140 
00141 //________________________________________________________________________
00142 void TBufferSQL::ReadDouble(Double_t &d)
00143 {
00144    // Operator>>
00145 
00146    d = atof((*fRowPtr)->GetField(*fIter));
00147    
00148    if (fIter != fColumnVec->end()) ++fIter;
00149 }
00150 
00151 
00152 //________________________________________________________________________
00153 void TBufferSQL::WriteBool(Bool_t    b)
00154 {
00155    // Operator<<
00156 
00157    (*fInsertQuery) += b;
00158    (*fInsertQuery) += ",";
00159    if (fIter != fColumnVec->end()) ++fIter;
00160 }
00161 
00162 //________________________________________________________________________
00163 void TBufferSQL::WriteChar(Char_t    c)
00164 {
00165    // Operator<<
00166 
00167    (*fInsertQuery) += c;
00168    (*fInsertQuery) += ",";
00169    if (fIter != fColumnVec->end()) ++fIter;
00170 }
00171 
00172 //________________________________________________________________________
00173 void TBufferSQL::WriteShort(Short_t   h)
00174 {
00175    // Operator<<
00176 
00177    (*fInsertQuery) += h;
00178    (*fInsertQuery) += ",";
00179    if (fIter != fColumnVec->end()) ++fIter;
00180 }
00181 
00182 //________________________________________________________________________
00183 void TBufferSQL::WriteInt(Int_t     i)
00184 {
00185    // Operator<<
00186 
00187    (*fInsertQuery) += i;
00188    (*fInsertQuery) += ",";
00189    if (fIter != fColumnVec->end()) ++fIter;
00190 }
00191 
00192 //________________________________________________________________________
00193 void TBufferSQL::WriteLong(Long_t    l)
00194 {
00195    // Operator<<
00196 
00197    (*fInsertQuery) += l;
00198    (*fInsertQuery) += ",";
00199    if (fIter != fColumnVec->end()) ++fIter;
00200 }
00201 
00202 //________________________________________________________________________
00203 void TBufferSQL::WriteFloat(Float_t   f)
00204 {
00205    // Operator<<
00206 
00207    (*fInsertQuery) += f;
00208    (*fInsertQuery) += ",";
00209    if (fIter != fColumnVec->end()) ++fIter;
00210 }
00211 
00212 //________________________________________________________________________
00213 void TBufferSQL::WriteDouble(Double_t  d)
00214 {
00215    // Operator<<
00216 
00217    (*fInsertQuery) += d;
00218    (*fInsertQuery) += ",";
00219    if (fIter != fColumnVec->end()) ++fIter;
00220 }
00221  
00222 //________________________________________________________________________
00223 void TBufferSQL::ReadUChar(UChar_t& uc)
00224 {
00225    // Operator>>
00226 
00227    uc = (UChar_t)atoi((*fRowPtr)->GetField(*fIter));
00228    
00229    if (fIter != fColumnVec->end()) ++fIter;
00230 }
00231 
00232 //________________________________________________________________________
00233 void TBufferSQL::ReadUShort(UShort_t& us)
00234 {
00235    // Operator>>
00236 
00237    us = (UShort_t)atoi((*fRowPtr)->GetField(*fIter));
00238    
00239    if (fIter != fColumnVec->end()) ++fIter;
00240 }
00241 
00242 //________________________________________________________________________
00243 void TBufferSQL::ReadUInt(UInt_t& ui)
00244 {
00245    // Operator>>
00246 
00247    TString val = (*fRowPtr)->GetField(*fIter);
00248    Int_t code = sscanf(val.Data(), "%u",&ui);
00249    if(code == 0) Error("operator>>(UInt_t&)","Error reading UInt_t");
00250 
00251    if (fIter != fColumnVec->end()) ++fIter;
00252 }
00253 
00254 //________________________________________________________________________
00255 void TBufferSQL::ReadULong(ULong_t& ul)
00256 {
00257    // Operator>>
00258 
00259    TString val = (*fRowPtr)->GetField(*fIter);
00260    Int_t code = sscanf(val.Data(), "%lu",&ul);
00261    if(code == 0) Error("operator>>(ULong_t&)","Error reading ULong_t");
00262 
00263    if (fIter != fColumnVec->end()) ++fIter;
00264 }
00265 
00266 //________________________________________________________________________
00267 void TBufferSQL::ReadLong64(Long64_t &ll)
00268 {
00269    // Operator>>
00270 
00271    TString val = (*fRowPtr)->GetField(*fIter);
00272    Int_t code = sscanf(val.Data(), "%lld",&ll);
00273    if(code == 0) Error("operator>>(ULong_t&)","Error reading Long64_t");
00274 
00275    if (fIter != fColumnVec->end()) ++fIter;
00276 }
00277 
00278 //________________________________________________________________________
00279 void TBufferSQL::ReadULong64(ULong64_t &ull)
00280 {
00281    // Operator>>
00282 
00283    TString val = (*fRowPtr)->GetField(*fIter);
00284    Int_t code = sscanf(val.Data(), "%llu",&ull);
00285    if(code == 0) Error("operator>>(ULong_t&)","Error reading ULong64_t");
00286 
00287    if (fIter != fColumnVec->end()) ++fIter;
00288 }
00289 
00290 //________________________________________________________________________
00291 void TBufferSQL::ReadCharP(Char_t *str)
00292 {
00293    // Operator>>
00294 
00295    strcpy(str,(*fRowPtr)->GetField(*fIter));  // Legacy interface, we have no way to know the user's buffer size ....
00296    if (fIter != fColumnVec->end()) ++fIter;
00297 }
00298 
00299 //________________________________________________________________________
00300 void TBufferSQL::ReadTString(TString   &)
00301 {
00302    // Operator>>
00303 
00304    //strcpy(str,(*fRowPtr)->GetField(*fIter));
00305    //if (fIter != fColumnVec->end()) ++fIter;
00306    printf("ERROR NOT IMPLEMENTED\n");
00307 }
00308 
00309 //________________________________________________________________________
00310 void TBufferSQL::WriteTString(const TString   &)
00311 {
00312    // Operator>>
00313 
00314    //strcpy(str,(*fRowPtr)->GetField(*fIter));
00315    //if (fIter != fColumnVec->end()) ++fIter;
00316    printf("ERROR NOT IMPLEMENTED\n");
00317 }
00318 
00319 // Method to send to database.
00320 
00321 //________________________________________________________________________
00322 void TBufferSQL::WriteUChar(UChar_t uc)
00323 {
00324    // Operator<<
00325 
00326    (*fInsertQuery) += uc;
00327    (*fInsertQuery) += ",";
00328    ++fIter;
00329 }
00330 
00331 //________________________________________________________________________
00332 void TBufferSQL::WriteUShort(UShort_t us)
00333 {
00334    // Operator<<
00335 
00336    (*fInsertQuery) += us;
00337    (*fInsertQuery) += ",";
00338    ++fIter;
00339 }
00340 
00341 //________________________________________________________________________
00342 void TBufferSQL::WriteUInt(UInt_t ui)
00343 {
00344    // Operator<<
00345 
00346    (*fInsertQuery) += ui;
00347    (*fInsertQuery) += ",";
00348    ++fIter;
00349 }
00350 
00351 //________________________________________________________________________
00352 void TBufferSQL::WriteULong(ULong_t ul)
00353 {
00354    // Operator<<
00355 
00356    (*fInsertQuery) += ul;
00357    (*fInsertQuery) += ",";
00358    ++fIter;
00359 }
00360 
00361 //________________________________________________________________________
00362 void TBufferSQL::WriteLong64(Long64_t ll)
00363 {
00364    // Operator<<
00365 
00366    (*fInsertQuery) += ll;
00367    (*fInsertQuery) += ",";
00368    ++fIter;
00369 }
00370 
00371 //________________________________________________________________________
00372 void TBufferSQL::WriteULong64(ULong64_t ull)
00373 {
00374    // Operator<<
00375 
00376    (*fInsertQuery) += ull;
00377    (*fInsertQuery) += ",";
00378    ++fIter;
00379 }
00380 
00381 //________________________________________________________________________
00382 void TBufferSQL::WriteCharP(const Char_t *str)
00383 {
00384    // Operator<<
00385 
00386    (*fInsertQuery) += "\"";
00387    (*fInsertQuery) += str;
00388    (*fInsertQuery) += "\",";
00389     ++fIter;
00390 }
00391 
00392 //________________________________________________________________________
00393 void TBufferSQL::WriteFastArray(const Bool_t *b, Int_t n)
00394 {
00395    // WriteFastArray SQL implementation.   
00396    for(int i=0; i<n; ++i) {
00397       (*fInsertQuery) += b[i];
00398       (*fInsertQuery) += ",";
00399       ++fIter;
00400    }
00401 }
00402 
00403 //________________________________________________________________________
00404 void TBufferSQL::WriteFastArray(const Char_t *c, Int_t n)
00405 {
00406    // WriteFastArray SQL implementation.   
00407 
00408    for(int i=0; i<n; ++i) {
00409       (*fInsertQuery) += (Short_t)c[i];
00410       (*fInsertQuery) += ",";
00411       ++fIter;
00412    }
00413 }
00414 
00415 //________________________________________________________________________
00416 void TBufferSQL::WriteFastArrayString(const Char_t *c, Int_t /* n */)
00417 {
00418    // WriteFastArray SQL implementation.   
00419 
00420    (*fInsertQuery) += "\"";
00421    (*fInsertQuery) += c;
00422    (*fInsertQuery) += "\",";
00423    ++fIter;
00424 }
00425 
00426 //________________________________________________________________________
00427 void TBufferSQL::WriteFastArray(const UChar_t *uc, Int_t n)
00428 {
00429    // WriteFastArray SQL implementation.   
00430 
00431    for(int i=0; i<n; ++i) {
00432       (*fInsertQuery) += uc[i];
00433       (*fInsertQuery) += ",";
00434       ++fIter;
00435    }
00436 }
00437 
00438 //________________________________________________________________________
00439 void TBufferSQL::WriteFastArray(const Short_t *h, Int_t n)
00440 {
00441    // WriteFastArray SQL implementation.   
00442 
00443    for(int i=0; i<n; ++i) {
00444       (*fInsertQuery) += h[i];
00445       (*fInsertQuery) += ",";
00446       ++fIter;
00447    }
00448 }
00449 
00450 //________________________________________________________________________
00451 void TBufferSQL::WriteFastArray(const UShort_t *us, Int_t n)
00452 {
00453    // WriteFastArray SQL implementation.   
00454 
00455    for(int i=0; i<n; ++i) {
00456       (*fInsertQuery) += us[i];
00457       (*fInsertQuery) += ",";
00458       ++fIter;
00459    }
00460 }
00461 
00462 //________________________________________________________________________
00463 void TBufferSQL::WriteFastArray(const Int_t     *ii, Int_t n)
00464 {
00465    // WriteFastArray SQL implementation.   
00466 
00467     //   cerr << "Column: " <<*fIter << "   i:" << *ii << endl;
00468    for(int i=0; i<n; ++i) {
00469       (*fInsertQuery) += ii[i];
00470       (*fInsertQuery) += ",";
00471       ++fIter;
00472    }
00473 }
00474 
00475 //________________________________________________________________________
00476 void TBufferSQL::WriteFastArray(const UInt_t *ui, Int_t n)
00477 {
00478    // WriteFastArray SQL implementation.   
00479 
00480    for(int i=0; i<n; ++i) {
00481       (*fInsertQuery) += ui[i];
00482       (*fInsertQuery) += ",";
00483       ++fIter;
00484    }
00485 }
00486 
00487 //________________________________________________________________________
00488 void TBufferSQL::WriteFastArray(const Long_t    *l, Int_t n)
00489 {
00490    // WriteFastArray SQL implementation.   
00491 
00492    for(int i=0; i<n; ++i) {
00493       (*fInsertQuery)+= l[i];
00494       (*fInsertQuery)+= ",";
00495       ++fIter;
00496    }
00497 }
00498 
00499 //________________________________________________________________________
00500 void TBufferSQL::WriteFastArray(const ULong_t   *ul, Int_t n)
00501 {
00502    // WriteFastArray SQL implementation.   
00503 
00504    for(int i=0; i<n; ++i) {
00505       (*fInsertQuery) += ul[i];
00506       (*fInsertQuery) += ",";
00507       ++fIter;
00508    }
00509 }
00510 
00511 //________________________________________________________________________
00512 void TBufferSQL::WriteFastArray(const Long64_t  *l, Int_t n)
00513 {
00514    // WriteFastArray SQL implementation.   
00515 
00516    for(int i=0; i<n; ++i) {
00517       (*fInsertQuery) += l[i];
00518       (*fInsertQuery) += ",";
00519       ++fIter;
00520    }
00521 }
00522 
00523 //________________________________________________________________________
00524 void TBufferSQL::WriteFastArray(const ULong64_t *ul, Int_t n)
00525 {
00526    // WriteFastArray SQL implementation.   
00527 
00528    for(int i=0; i<n; ++i) {
00529       (*fInsertQuery) += ul[i];
00530       (*fInsertQuery) += ",";
00531       ++fIter;
00532    }
00533 }
00534 
00535 //________________________________________________________________________
00536 void TBufferSQL::WriteFastArray(const Float_t   *f, Int_t n)
00537 {
00538    // WriteFastArray SQL implementation.   
00539 
00540    for(int i=0; i<n; ++i) {
00541       (*fInsertQuery) += f[i];
00542       (*fInsertQuery) += ",";
00543       ++fIter;
00544    }
00545 }
00546 
00547 //________________________________________________________________________
00548 void TBufferSQL::WriteFastArray(const Double_t  *d, Int_t n)
00549 {
00550    // WriteFastArray SQL implementation.   
00551 
00552    for(int i=0; i<n; ++i) {
00553       (*fInsertQuery) += d[i];
00554       (*fInsertQuery )+= ",";
00555       ++fIter;
00556    }
00557 }
00558 
00559 //________________________________________________________________________
00560 void TBufferSQL::WriteFastArray(void*, const TClass*, Int_t, TMemberStreamer *)
00561 {
00562    // WriteFastArray SQL implementation.   
00563 
00564    Fatal("riteFastArray(void*, const TClass*, Int_t, TMemberStreamer *)","Not implemented yet");
00565 }
00566 
00567 //________________________________________________________________________
00568 Int_t TBufferSQL::WriteFastArray(void **, const TClass*, Int_t, Bool_t, TMemberStreamer*)
00569 {
00570    // WriteFastArray SQL implementation.   
00571 
00572    Fatal("WriteFastArray(void **, const TClass*, Int_t, Bool_t, TMemberStreamer*)","Not implemented yet");
00573    return 0;
00574 }
00575 
00576 //________________________________________________________________________
00577 void TBufferSQL::ReadFastArray(Bool_t *b, Int_t n)
00578 {
00579    // ReadFastArray SQL implementation.   
00580 
00581    for(int i=0; i<n; ++i) {  
00582       b[i] = (Bool_t)atoi((*fRowPtr)->GetField(*fIter));
00583       ++fIter;
00584    }
00585 }
00586 
00587 //________________________________________________________________________
00588 void TBufferSQL::ReadFastArray(Char_t *c, Int_t n)
00589 {
00590    // ReadFastArray SQL implementation.   
00591    for(int i=0; i<n; ++i) {  
00592       c[i] = (Char_t)atoi((*fRowPtr)->GetField(*fIter));
00593       ++fIter;
00594    }
00595 }
00596 
00597 //________________________________________________________________________
00598 void TBufferSQL::ReadFastArrayString(Char_t *c, Int_t /* n */)
00599 {
00600    // ReadFastArray SQL implementation.   
00601    strcpy(c,((*fRowPtr)->GetField(*fIter)));
00602    ++fIter;
00603 }
00604 
00605 //________________________________________________________________________
00606 void TBufferSQL::ReadFastArray(UChar_t *uc, Int_t n)
00607 {
00608    // ReadFastArray SQL implementation.   
00609    for(int i=0; i<n; ++i) {  
00610       uc[i] = (UChar_t)atoi((*fRowPtr)->GetField(*fIter));
00611       ++fIter;
00612    }
00613 }
00614 
00615 //________________________________________________________________________
00616 void TBufferSQL::ReadFastArray(Short_t *s, Int_t n)
00617 {
00618    // ReadFastArray SQL implementation.   
00619    for(int i=0; i<n; ++i) {  
00620       s[i] = (Short_t)atoi((*fRowPtr)->GetField(*fIter));
00621       ++fIter;
00622    }
00623 }
00624 
00625 //________________________________________________________________________
00626 void TBufferSQL::ReadFastArray(UShort_t *us, Int_t n)
00627 {
00628    // ReadFastArray SQL implementation.   
00629    for(int i=0; i<n; ++i) {  
00630       us[i] = (UShort_t)atoi((*fRowPtr)->GetField(*fIter));
00631       ++fIter;
00632    }
00633 }
00634 
00635 //________________________________________________________________________
00636 void     TBufferSQL::ReadFastArray(Int_t *in, Int_t n)
00637 {
00638    // ReadFastArray SQL implementation.   
00639    for(int i=0; i<n; ++i) {  
00640       in[i] = atoi((*fRowPtr)->GetField(*fIter));
00641       ++fIter;
00642    }
00643 }
00644 
00645 //________________________________________________________________________
00646 void     TBufferSQL::ReadFastArray(UInt_t *ui, Int_t n)
00647 {
00648    // ReadFastArray SQL implementation.   
00649    for(int i=0; i<n; ++i) {  
00650       ui[i] = atoi((*fRowPtr)->GetField(*fIter));
00651       ++fIter;
00652    }
00653 }
00654 
00655 //________________________________________________________________________
00656 void TBufferSQL::ReadFastArray(Long_t *l, Int_t n)
00657 {
00658    // ReadFastArray SQL implementation.   
00659    for(int i=0; i<n; ++i) {  
00660       l[i] = atol((*fRowPtr)->GetField(*fIter));
00661       ++fIter;
00662    }
00663 }
00664 
00665 //________________________________________________________________________
00666 void TBufferSQL::ReadFastArray(ULong_t   *ul, Int_t n)
00667 {
00668    // ReadFastArray SQL implementation.   
00669    for(int i=0; i<n; ++i) {  
00670       (*this) >> ul[i];
00671    }
00672 }
00673 
00674 //________________________________________________________________________
00675 void TBufferSQL::ReadFastArray(Long64_t  *ll, Int_t n)
00676 {
00677    // ReadFastArray SQL implementation.   
00678    for(int i=0; i<n; ++i) {  
00679       (*this) >> ll[i];
00680    }
00681 }
00682 
00683 //________________________________________________________________________
00684 void TBufferSQL::ReadFastArray(ULong64_t *ull, Int_t n)
00685 {
00686    // ReadFastArray SQL implementation.   
00687    for(int i=0; i<n; ++i) {  
00688       (*this) >> ull[i];
00689    }
00690 }
00691 
00692 //________________________________________________________________________
00693 void TBufferSQL::ReadFastArray(Float_t   *f, Int_t n)
00694 {
00695    // ReadFastArray SQL implementation.   
00696    for(int i=0; i<n; ++i) {  
00697       f[i] = atof((*fRowPtr)->GetField(*fIter));
00698       ++fIter;
00699    }
00700 }
00701 
00702 //________________________________________________________________________
00703 void TBufferSQL::ReadFastArray(Double_t *d, Int_t n)
00704 {
00705    // ReadFastArray SQL implementation.   
00706    for(int i=0; i<n; ++i) {  
00707       d[i] = atof((*fRowPtr)->GetField(*fIter));
00708       ++fIter;
00709    }
00710 }
00711 
00712 //________________________________________________________________________
00713 void     TBufferSQL::ReadFastArrayFloat16(Float_t  *, Int_t , TStreamerElement *)
00714 {
00715    // ReadFastArray SQL implementation.   
00716    Fatal("ReadFastArrayFloat16(Float_t  *, Int_t , TStreamerElement *)","Not implemented yet");
00717 }
00718 
00719 //________________________________________________________________________
00720 void     TBufferSQL::ReadFastArrayDouble32(Double_t  *, Int_t , TStreamerElement *)
00721 {
00722    // ReadFastArray SQL implementation.   
00723    Fatal("ReadFastArrayDouble32(Double_t  *, Int_t , TStreamerElement *)","Not implemented yet");
00724 }
00725 
00726 //________________________________________________________________________
00727 void     TBufferSQL::ReadFastArray(void  *, const TClass *, Int_t, TMemberStreamer *, const TClass *)
00728 {
00729    // ReadFastArray SQL implementation.   
00730    Fatal("ReadFastArray(void  *, const TClass *, Int_t, TMemberStreamer *, const TClass *)","Not implemented yet");
00731 }
00732 
00733 //________________________________________________________________________
00734 void     TBufferSQL::ReadFastArray(void **, const TClass *, Int_t, Bool_t, TMemberStreamer *, const TClass *)
00735 {
00736    // ReadFastArray SQL implementation.   
00737    Fatal("ReadFastArray(void **, const TClass *, Int_t, Bool_t, TMemberStreamer *, const TClass *)","Not implemented yet");
00738 }
00739 
00740 //________________________________________________________________________
00741 void TBufferSQL::ResetOffset() 
00742 {
00743    // Reset Offset.
00744    fIter = fColumnVec->begin();
00745 }
00746 
00747 #if 0
00748 //________________________________________________________________________
00749 void TBufferSQL::insert_test(const char* dsn, const char* usr, 
00750                              const char* pwd, const TString& tblname) 
00751 {
00752    TString str;
00753    TString select = "select * from ";
00754    TString sql;
00755    TSQLStatement* stmt; 
00756    sql = select + "ins";
00757    
00758    con = gSQLDriverManager->GetConnection(dsn,usr,pwd);
00759    
00760    if(!con)
00761       printf("\n\n\nConnection NOT Successful\n\n\n");
00762    else
00763       printf("\n\n\nConnection Sucessful\n\n\n");
00764    
00765    
00766    
00767    stmt = con->CreateStatement(0, odbc::ResultSet::CONCUR_READ_ONLY);
00768    
00769    ptr = stmt->ExecuteQuery(sql.Data()); 
00770    if(!ptr) printf("No recorSet found!");       
00771    
00772    ptr->Next();
00773    ptr->MoveToInsertRow();
00774    cerr << "IsAfterLast(): " << ptr->IsAfterLast() << endl;
00775    ptr->UpdateInt(1, 5555);
00776    ptr->InsertRow();
00777    con->Commit();
00778    
00779    ptr1 = stmt->ExecuteQuery(sql.Data());
00780    
00781 }
00782 #endif

Generated on Tue Jul 5 15:33:39 2011 for ROOT_528-00b_version by  doxygen 1.5.1