36 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(
r)
47 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(
r)
57 void *buf,
bool adopt) :
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) +=
"\",";
429 constexpr Int_t dataWidth = 2;
430 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
431 if (n < 0 || n > maxElements)
433 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
436 for(
int i=0; i<
n; ++i) {
437 (*fInsertQuery) +=
b[i];
438 (*fInsertQuery) +=
",";
449 constexpr Int_t dataWidth = 2;
450 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
451 if (n < 0 || n > maxElements)
453 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
456 for(
int i=0; i<
n; ++i) {
458 (*fInsertQuery) +=
",";
469 constexpr Int_t dataWidth = 4;
470 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
473 Fatal(
"WriteFastArrayString",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", 1LL, maxElements);
476 (*fInsertQuery) +=
"\"";
477 (*fInsertQuery) +=
c;
478 (*fInsertQuery) +=
"\",";
488 constexpr Int_t dataWidth = 2;
489 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
490 if (n < 0 || n > maxElements)
492 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
495 for(
int i=0; i<
n; ++i) {
496 (*fInsertQuery) += uc[i];
497 (*fInsertQuery) +=
",";
508 constexpr Int_t dataWidth = 2;
509 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
510 if (n < 0 || n > maxElements)
512 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
515 for(
int i=0; i<
n; ++i) {
516 (*fInsertQuery) +=
h[i];
517 (*fInsertQuery) +=
",";
529 constexpr Int_t dataWidth = 2;
530 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
531 if (n < 0 || n > maxElements)
533 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
536 for(
int i=0; i<
n; ++i) {
537 (*fInsertQuery) += us[i];
538 (*fInsertQuery) +=
",";
549 constexpr Int_t dataWidth = 2;
550 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
551 if (n < 0 || n > maxElements)
553 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
557 for(
int i=0; i<
n; ++i) {
558 (*fInsertQuery) += ii[i];
559 (*fInsertQuery) +=
",";
570 constexpr Int_t dataWidth = 2;
571 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
572 if (n < 0 || n > maxElements)
574 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
577 for(
int i=0; i<
n; ++i) {
578 (*fInsertQuery) += ui[i];
579 (*fInsertQuery) +=
",";
590 constexpr Int_t dataWidth = 2;
591 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
592 if (n < 0 || n > maxElements)
594 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
597 for(
int i=0; i<
n; ++i) {
598 (*fInsertQuery)+=
l[i];
599 (*fInsertQuery)+=
",";
610 constexpr Int_t dataWidth = 2;
611 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
612 if (n < 0 || n > maxElements)
614 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
617 for(
int i=0; i<
n; ++i) {
618 (*fInsertQuery) += ul[i];
619 (*fInsertQuery) +=
",";
630 constexpr Int_t dataWidth = 2;
631 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
632 if (n < 0 || n > maxElements)
634 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
637 for(
int i=0; i<
n; ++i) {
638 (*fInsertQuery) +=
l[i];
639 (*fInsertQuery) +=
",";
650 constexpr Int_t dataWidth = 2;
651 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
652 if (n < 0 || n > maxElements)
654 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
657 for(
int i=0; i<
n; ++i) {
658 (*fInsertQuery) += ul[i];
659 (*fInsertQuery) +=
",";
670 constexpr Int_t dataWidth = 2;
671 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
672 if (n < 0 || n > maxElements)
674 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
677 for(
int i=0; i<
n; ++i) {
678 (*fInsertQuery) +=
f[i];
679 (*fInsertQuery) +=
",";
690 constexpr Int_t dataWidth = 2;
691 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
692 if (n < 0 || n > maxElements)
694 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
697 for(
int i=0; i<
n; ++i) {
698 (*fInsertQuery) +=
d[i];
699 (*fInsertQuery )+=
",";
710 Fatal(
"WriteFastArray(void*, const TClass*, Long64_t, TMemberStreamer *)",
"Not implemented yet");
719 Fatal(
"WriteFastArray(void **, const TClass*, Long64_t, bool, TMemberStreamer*)",
"Not implemented yet");
728 for(
int i=0; i<
n; ++i) {
729 b[i] = (
bool)atoi((*fRowPtr)->GetField(*
fIter));
739 for(
int i=0; i<
n; ++i) {
750 strcpy(
c,((*fRowPtr)->GetField(*
fIter)));
759 for(
int i=0; i<
n; ++i) {
770 for(
int i=0; i<
n; ++i) {
781 for(
int i=0; i<
n; ++i) {
792 for(
int i=0; i<
n; ++i) {
793 in[i] = atoi((*fRowPtr)->GetField(*
fIter));
803 for(
int i=0; i<
n; ++i) {
804 ui[i] = atoi((*fRowPtr)->GetField(*
fIter));
814 for(
int i=0; i<
n; ++i) {
815 l[i] = atol((*fRowPtr)->GetField(*
fIter));
825 for(
int i=0; i<
n; ++i) {
835 for(
int i=0; i<
n; ++i) {
845 for(
int i=0; i<
n; ++i) {
855 for(
int i=0; i<
n; ++i) {
856 f[i] = atof((*fRowPtr)->GetField(*
fIter));
866 for(
int i=0; i<
n; ++i) {
867 d[i] = atof((*fRowPtr)->GetField(*
fIter));
877 Fatal(
"ReadFastArrayFloat16(Float_t *, Int_t , TStreamerElement *)",
"Not implemented yet");
885 Fatal(
"ReadFastArrayWithFactor(Float_t *, Int_t, Double_t, Double_t)",
"Not implemented yet");
893 Fatal(
"ReadFastArrayWithNbits(Float_t *, Int_t , Int_t )",
"Not implemented yet");
901 Fatal(
"ReadFastArrayWithFactor(Double_t *, Int_t, Double_t, Double_t)",
"Not implemented yet");
909 Fatal(
"ReadFastArrayWithNbits(Double_t *, Int_t , Int_t )",
"Not implemented yet");
917 Fatal(
"ReadFastArrayDouble32(Double_t *, Int_t , TStreamerElement *)",
"Not implemented yet");
925 Fatal(
"ReadFastArray(void *, const TClass *, Int_t, TMemberStreamer *, const TClass *)",
"Not implemented yet");
933 Fatal(
"ReadFastArray(void **, const TClass *, Int_t, bool, TMemberStreamer *, const TClass *)",
"Not implemented yet");
947void TBufferSQL::insert_test(
const char* dsn,
const char* usr,
948 const char* pwd,
const TString& tblname)
951 TString select =
"select * from ";
954 sql = select +
"ins";
956 con = gSQLDriverManager->GetConnection(dsn,usr,pwd);
959 printf(
"\n\n\nConnection NOT Successful\n\n\n");
961 printf(
"\n\n\nConnection Sucessful\n\n\n");
963 stmt = con->CreateStatement(0, odbc::ResultSet::CONCUR_READ_ONLY);
965 ptr = stmt->ExecuteQuery(sql.
Data());
966 if(!ptr) printf(
"No recorSet found!");
969 ptr->MoveToInsertRow();
970 std::cerr <<
"IsAfterLast(): " << ptr->IsAfterLast() << std::endl;
971 ptr->UpdateInt(1, 5555);
975 ptr1 = stmt->ExecuteQuery(sql.
Data());
unsigned long long ULong64_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char mode
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 ReadFastArray(bool *, Int_t) final
ReadFastArray SQL implementation.
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
void WriteFastArrayString(const Char_t *c, Long64_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 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 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 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 WriteULong64(ULong64_t l) final
Operator<<.
~TBufferSQL() override
Destructor.
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 WriteFastArray(const bool *b, Long64_t n) final
WriteFastArray SQL implementation.
void ResetOffset()
Reset Offset.
void WriteBool(bool b) final
Operator<<.
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 ReadBool(bool &b) 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