155 fImp =
new ConnectionPrivate();
156 fListOfStatements =
new TList();
177 fImp =
new ConnectionPrivate();
185 const TString& password ):
TSQL(0)
210 if( mysql_real_connect( imp->
fMYSQL, url.GetHost().Data(),
211 username.Data(), password.Data(),
212 url.GetDatabase().Data(),
213 url.GetPort(),
const char *unix_socket,
unsigned int client_flag) compress,
214 connect_timeout,socket_name, client_flag))
265 Int_t resultSetConcurrency )
351 Throw(
new TSQLSQLException(
"Callable statements not supported.",
"S1C00",4000);
359 Int_t resultSetConcurrency )
387 Int_t resultSetConcurrency )
407 Throw(
new TSQLSQLException(
"Callable statments not suppoted.",
"S1C00",4000);
455 if (autoCommit == kFALSE) {
557 if(!imp->fIsClosed) {
559 rs = execSQL(gPING_COMMAND, -1);
562 imp->fIsClosed = !rs;
563 return imp->fIsClosed;
641 if( !mysql_select_db(imp->
fMYSQL,catalog) ) {
645 imp->fDatabase = catalog;
665 return imp->fDatabase;
689 Throw(
new TSQLException(
"Transaction Isolation Levels are not supported.",
"S1C00",4000);
764 const char*
s(Bool_t
b)
777 if(qc!=
" ") res = qc + str + qc;
784 Int_t rsType,
const char*
name)
792 printf(
" + kCONCUR_READ_ONLY\n");
796 printf(
" + kCONCUR_UPDATABLE\n");
800 printf(
" Own inserts are visible\n");
804 printf(
" Own updates are visible\n");
807 printf(
" Own deletes are visible\n");
833 printf(
"Supports transactions : %s\n",str.Data());
835 printf(
"\nTransaction support \n");
836 printf(
"---------------------------------------------------\n");
839 printf(
"This datasource does not support transactions.\n\n");
845 for(
int i=0;
levels[
i].name!=NULL;
i++) {
849 str += (
levels[
i].id==defIsolation) ?
" (default)" :
"";
850 printf(
"%s\n",str.Data());
856 printf(
" Both DML and DDL can be used within a transaction\n");
858 printf(
" Only DML can be used within a transaction\n");
860 printf(
" DDL causes commit\n");
862 printf(
" DDL is ignored in transactions\n");
876 Bool_t hasCatalogs = cdml || cproc || ctd || cid || cpd;
879 printf(
"Supported catalog uses\n");
880 printf(
"--------------------------------------------------- \n");
881 printf(
"Data manipulation : %s\n",
s(cdml) );
882 printf(
"Procedure calls : %s\n",
s(cproc) );
883 printf(
"Table definitions : %s\n",
s(ctd) );
884 printf(
"Index definitions : %s\n",
s(cid) );
885 printf(
"Privilege definitions: %s\n",
s(cpd) );
887 printf(
"This datasource does not support catalogs\n");
898 id = catTerm + catSep +
id;
900 id =
id + catSep + catTerm;
903 printf(
"Preferred table identifier format: %s\n",
id.
Data());
916 Bool_t hasSchemas=sdml || sproc || std || sid || spd;
919 printf(
"Supported schema uses\n");
920 printf(
"--------------------------------------------------- \n");
921 printf(
"Data manipulation : %s\n",
s(sdml) );
922 printf(
"Procedure calls : %s\n",
s(sproc) );
923 printf(
"Table definitions : %s\n",
s(std) );
924 printf(
"Index definitions : %s\n",
s(sid) );
925 printf(
"Privilege definitions: %s\n",
s(spd) );
927 printf(
"This datasource does not support schemas\n");
945 printf(
"Product name : %s\n",str.Data());
948 printf(
"Product version : %s\n",str.Data());
959 printf(
"Driver name : %s\n",str.Data());
962 printf(
"Driver version : %s\n",str.Data());
973 printf(
"Supported system functions \n");
974 printf(
"--------------------------------------------------- \n");
975 printf(
"%s\n\n",str.Data());
977 printf(
"Supported string functions\n");
978 printf(
"--------------------------------------------------- \n");
980 printf(
"%s\n\n",str.Data());
982 printf(
"Supported time/date functions\n");
983 printf(
"--------------------------------------------------- \n");
985 printf(
"%s\n\n",str.Data());
987 printf(
"Supported numeric functions\n");
988 printf(
"---------------------------------------------------\n");
990 printf(
"%s\n\n",str.Data());
1000 printf(
"Non-ODBC SQL keywords\n");
1001 printf(
"--------------------------------------------------- \n");
1003 printf(
"%s\n\n",str.Data());
1023 TString opt = option;
1027 printf(
"=================================================== \n\n");
1029 if(opt.Contains(
"p") || opt.Contains(
"a")) {
1031 printf(
"=================================================== \n\n");
1033 if(opt.Contains(
"d") || opt.Contains(
"a")) {
1035 printf(
"=================================================== \n\n");
1037 if(opt.Contains(
"t") || opt.Contains(
"a")) {
1039 printf(
"=================================================== \n\n");
1041 if(opt.Contains(
"f") || opt.Contains(
"a")) {
1043 printf(
"=================================================== \n\n");
1045 if(opt.Contains(
"k") || opt.Contains(
"a")) {
1047 printf(
"=================================================== \n\n");
1050 if(opt.Contains(
"r") || opt.Contains(
"a")) {
1051 printf(
"Supported TSQLResultSet types\n");
1052 printf(
"--------------------------------------------------- \n");
1056 printf(
"\n=================================================== \n");
1058 if(opt.Contains(
"c") || opt.Contains(
"a")) {
1060 printf(
"=================================================== \n\n");
1062 if(opt.Contains(
"s") || opt.Contains(
"a")) {
1064 printf(
"=================================================== \n\n");
1087 void TSQLConnection::SetLoginTimeout( Int_t seconds )
1100 Int_t TSQLConnection::GetLoginTimeout()
1113 void TSQLConnection::Shutdown()
1119 Bool_t suc = !(mysql_shutdown(imp->
fMYSQL));
1125 TList* TSQLConnection::RefreshDrivers(TList*
gDrivers)
1130 if(!gDrivers)
return 0;
1136 TList* TSQLConnection::RefreshDataSources(TList* gDataSources)
1140 if(!gDataSources)
return 0;
1142 gDataSources->Delete();
1145 return gDataSources;