ROOT
Version v6.32
master
v6.36
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
sqlcreatedb.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_sql
3
/// Create a runcatalog table in a MySQL test database.
4
///
5
/// \macro_code
6
///
7
/// \author Sergey Linev
8
9
void
sqlcreatedb
()
10
{
11
// read in runcatalog table definition
12
FILE
*fp =
fopen
(
"runcatalog.sql"
,
"r"
);
13
const
char
sql
[4096];
14
fread
(
sql
, 1, 4096, fp);
15
fclose
(fp);
16
17
// open connection to MySQL server on localhost
18
TSQLServer
*
db
=
TSQLServer::Connect
(
"mysql://localhost/test"
,
"nobody"
,
""
);
19
20
TSQLResult
*res;
21
22
// create new table (delete old one first if exists)
23
res =
db
->Query(
"DROP TABLE runcatalog"
);
24
delete
res;
25
26
res =
db
->Query(
sql
);
27
delete
res;
28
29
delete
db
;
30
}
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TSQLResult
Definition
TSQLResult.h:31
TSQLServer
Definition
TSQLServer.h:41
TSQLServer::Connect
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
The db should be of the form: <dbms>://<host>[:<port>][/<database>], e.g.: mysql://pcroot....
Definition
TSQLServer.cxx:61
sqlcreatedb
Definition
sqlcreatedb.py:1
tutorials
sql
sqlcreatedb.C
ROOT v6-32 - Reference Guide Generated on Mon Apr 28 2025 05:42:20 (GVA Time) using Doxygen 1.10.0