36 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(
r)
47 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(
r)
59 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(
r)
114 i = atoi((*fRowPtr)->GetField(*
fIter));
124 f = atof((*fRowPtr)->GetField(*
fIter));
134 l = atol((*fRowPtr)->GetField(*
fIter));
144 d = atof((*fRowPtr)->GetField(*
fIter));
154 (*fInsertQuery) +=
b;
155 (*fInsertQuery) +=
",";
164 (*fInsertQuery) +=
c;
165 (*fInsertQuery) +=
",";
174 (*fInsertQuery) +=
h;
175 (*fInsertQuery) +=
",";
184 (*fInsertQuery) += i;
185 (*fInsertQuery) +=
",";
194 (*fInsertQuery) +=
l;
195 (*fInsertQuery) +=
",";
204 (*fInsertQuery) +=
f;
205 (*fInsertQuery) +=
",";
214 (*fInsertQuery) +=
d;
215 (*fInsertQuery) +=
",";
245 Int_t code = sscanf(val.
Data(),
"%u",&ui);
246 if(code == 0)
Error(
"operator>>(UInt_t&)",
"Error reading UInt_t");
257 Int_t code = sscanf(val.
Data(),
"%lu",&ul);
258 if(code == 0)
Error(
"operator>>(ULong_t&)",
"Error reading ULong_t");
269 Int_t code = sscanf(val.
Data(),
"%lld",&ll);
270 if(code == 0)
Error(
"operator>>(ULong_t&)",
"Error reading Long64_t");
281 Int_t code = sscanf(val.
Data(),
"%llu",&ull);
282 if(code == 0)
Error(
"operator>>(ULong_t&)",
"Error reading ULong64_t");
292 strcpy(str,(*fRowPtr)->GetField(*
fIter));
301 s = (*fRowPtr)->GetField(*
fIter);
310 (*fInsertQuery) += s;
311 (*fInsertQuery) +=
",";
357 (*fInsertQuery) += uc;
358 (*fInsertQuery) +=
",";
367 (*fInsertQuery) += us;
368 (*fInsertQuery) +=
",";
377 (*fInsertQuery) += ui;
378 (*fInsertQuery) +=
",";
387 (*fInsertQuery) += ul;
388 (*fInsertQuery) +=
",";
397 (*fInsertQuery) += ll;
398 (*fInsertQuery) +=
",";
407 (*fInsertQuery) += ull;
408 (*fInsertQuery) +=
",";
417 (*fInsertQuery) +=
"\"";
418 (*fInsertQuery) += str;
419 (*fInsertQuery) +=
"\",";
428 for(
int i=0; i<
n; ++i) {
429 (*fInsertQuery) +=
b[i];
430 (*fInsertQuery) +=
",";
440 for(
int i=0; i<
n; ++i) {
442 (*fInsertQuery) +=
",";
452 (*fInsertQuery) +=
"\"";
453 (*fInsertQuery) +=
c;
454 (*fInsertQuery) +=
"\",";
463 for(
int i=0; i<
n; ++i) {
464 (*fInsertQuery) += uc[i];
465 (*fInsertQuery) +=
",";
475 for(
int i=0; i<
n; ++i) {
476 (*fInsertQuery) +=
h[i];
477 (*fInsertQuery) +=
",";
487 for(
int i=0; i<
n; ++i) {
488 (*fInsertQuery) += us[i];
489 (*fInsertQuery) +=
",";
500 for(
int i=0; i<
n; ++i) {
501 (*fInsertQuery) += ii[i];
502 (*fInsertQuery) +=
",";
512 for(
int i=0; i<
n; ++i) {
513 (*fInsertQuery) += ui[i];
514 (*fInsertQuery) +=
",";
524 for(
int i=0; i<
n; ++i) {
525 (*fInsertQuery)+=
l[i];
526 (*fInsertQuery)+=
",";
536 for(
int i=0; i<
n; ++i) {
537 (*fInsertQuery) += ul[i];
538 (*fInsertQuery) +=
",";
548 for(
int i=0; i<
n; ++i) {
549 (*fInsertQuery) +=
l[i];
550 (*fInsertQuery) +=
",";
560 for(
int i=0; i<
n; ++i) {
561 (*fInsertQuery) += ul[i];
562 (*fInsertQuery) +=
",";
572 for(
int i=0; i<
n; ++i) {
573 (*fInsertQuery) +=
f[i];
574 (*fInsertQuery) +=
",";
584 for(
int i=0; i<
n; ++i) {
585 (*fInsertQuery) +=
d[i];
586 (*fInsertQuery )+=
",";
596 Fatal(
"WriteFastArray(void*, const TClass*, Int_t, TMemberStreamer *)",
"Not implemented yet");
604 Fatal(
"WriteFastArray(void **, const TClass*, Int_t, Bool_t, TMemberStreamer*)",
"Not implemented yet");
613 for(
int i=0; i<
n; ++i) {
624 for(
int i=0; i<
n; ++i) {
635 strcpy(
c,((*fRowPtr)->GetField(*
fIter)));
644 for(
int i=0; i<
n; ++i) {
655 for(
int i=0; i<
n; ++i) {
666 for(
int i=0; i<
n; ++i) {
677 for(
int i=0; i<
n; ++i) {
678 in[i] = atoi((*fRowPtr)->GetField(*
fIter));
688 for(
int i=0; i<
n; ++i) {
689 ui[i] = atoi((*fRowPtr)->GetField(*
fIter));
699 for(
int i=0; i<
n; ++i) {
700 l[i] = atol((*fRowPtr)->GetField(*
fIter));
710 for(
int i=0; i<
n; ++i) {
720 for(
int i=0; i<
n; ++i) {
730 for(
int i=0; i<
n; ++i) {
740 for(
int i=0; i<
n; ++i) {
741 f[i] = atof((*fRowPtr)->GetField(*
fIter));
751 for(
int i=0; i<
n; ++i) {
752 d[i] = atof((*fRowPtr)->GetField(*
fIter));
762 Fatal(
"ReadFastArrayFloat16(Float_t *, Int_t , TStreamerElement *)",
"Not implemented yet");
770 Fatal(
"ReadFastArrayWithFactor(Float_t *, Int_t, Double_t, Double_t)",
"Not implemented yet");
778 Fatal(
"ReadFastArrayWithNbits(Float_t *, Int_t , Int_t )",
"Not implemented yet");
786 Fatal(
"ReadFastArrayWithFactor(Double_t *, Int_t, Double_t, Double_t)",
"Not implemented yet");
794 Fatal(
"ReadFastArrayWithNbits(Double_t *, Int_t , Int_t )",
"Not implemented yet");
802 Fatal(
"ReadFastArrayDouble32(Double_t *, Int_t , TStreamerElement *)",
"Not implemented yet");
810 Fatal(
"ReadFastArray(void *, const TClass *, Int_t, TMemberStreamer *, const TClass *)",
"Not implemented yet");
818 Fatal(
"ReadFastArray(void **, const TClass *, Int_t, Bool_t, TMemberStreamer *, const TClass *)",
"Not implemented yet");
832void TBufferSQL::insert_test(
const char* dsn,
const char* usr,
833 const char* pwd,
const TString& tblname)
836 TString select =
"select * from ";
839 sql = select +
"ins";
841 con = gSQLDriverManager->GetConnection(dsn,usr,pwd);
844 printf(
"\n\n\nConnection NOT Successful\n\n\n");
846 printf(
"\n\n\nConnection Sucessful\n\n\n");
848 stmt = con->CreateStatement(0, odbc::ResultSet::CONCUR_READ_ONLY);
850 ptr = stmt->ExecuteQuery(sql.
Data());
851 if(!ptr) printf(
"No recorSet found!");
854 ptr->MoveToInsertRow();
855 std::cerr <<
"IsAfterLast(): " << ptr->IsAfterLast() << std::endl;
856 ptr->UpdateInt(1, 5555);
860 ptr1 = stmt->ExecuteQuery(sql.
Data());
unsigned long long ULong64_t
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void ReadCharStar(char *&s) override
Read char* from TBuffer.
void WriteCharStar(char *s) override
Write char* into TBuffer.
void WriteStdString(const std::string *s) override
Write std::string to TBuffer.
void ReadStdString(std::string *s) override
Read std::string from TBuffer.
Implement TBuffer for a SQL backend.
void ReadLong(Long_t &l) final
Operator>>
void WriteDouble(Double_t d) final
Operator<<.
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
void WriteFastArray(const Bool_t *b, Int_t n) final
WriteFastArray SQL implementation.
void WriteULong(ULong_t l) final
Operator<<.
void WriteUInt(UInt_t i) final
Operator<<.
void WriteFloat(Float_t f) final
Operator<<.
void ReadULong64(ULong64_t &l) final
Operator>>
void ReadCharStar(char *&s) final
Read a char* string.
void ReadInt(Int_t &i) final
Operator>>
void ReadTString(TString &s) final
Read a TString.
void WriteUChar(UChar_t c) final
Operator<<.
void WriteShort(Short_t s) final
Operator<<.
void WriteUShort(UShort_t s) final
Operator<<.
void ReadBool(Bool_t &b) final
Operator>>
void ReadShort(Short_t &s) final
Operator>>
void WriteLong(Long_t l) final
Operator<<.
void ReadLong64(Long64_t &l) final
Operator>>
void ReadChar(Char_t &c) final
Operator>>
std::vector< Int_t > * fColumnVec
void WriteFastArrayString(const Char_t *c, Int_t n) final
WriteFastArray SQL implementation.
void ReadFastArrayString(Char_t *, Int_t) final
ReadFastArray SQL implementation.
void WriteStdString(const std::string *s) final
Write a std::string.
void ReadStdString(std::string *s) final
Read a std::string.
void WriteInt(Int_t i) final
Operator<<.
void ReadFastArray(Bool_t *, Int_t) final
ReadFastArray SQL implementation.
void ReadUShort(UShort_t &s) final
Operator>>
void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final
Read array of Float16_t from buffer.
void WriteTString(const TString &s) final
Write a TString.
void ReadUInt(UInt_t &i) final
Operator>>
void WriteBool(Bool_t b) final
Operator<<.
void WriteULong64(ULong64_t l) final
Operator<<.
void ReadCharP(Char_t *c) final
Operator>>
void WriteCharStar(char *s) final
Write a char* string.
void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final
Read array of Float16_t from buffer.
std::vector< Int_t >::const_iterator fIter
void ResetOffset()
Reset Offset.
void WriteCharP(const Char_t *c) final
Operator<<.
void WriteLong64(Long64_t l) final
Operator<<.
void ReadDouble(Double_t &d) final
Operator>>
void ReadULong(ULong_t &l) final
Operator>>
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
void ReadFloat(Float_t &f) final
Operator>>
void WriteChar(Char_t c) final
Operator<<.
void ReadUChar(UChar_t &c) final
Operator>>
TClass instances represent classes, structs and namespaces in the ROOT type system.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * Data() const