Create a Tree directly from MySQL server

Hi
I need to create a visual display(like histograms TH1 and Graphs) with datas which are recorded in a mysql database.
Is there any tutorial or examples from where I can start?
Thanks
Sor

I get 29 files (and each file contains at least one c++ class) when I try:
ls -al ${ROOTSYS}/include/[sS][qQ][lL]
Search also for “sql” in the “ROOT Class Index” (though not all classes seem to be present in this list).
See also: ${ROOTSYS}/tutorials/sql/

Thanks I will try the sql tutorials.

Hi I cannot make the connection with the database using the TSQLServer (see documentation
root.cern.ch/root/html534/TSQLServer.html )

what could be the name for microsoft sql server

2012 Microsoft SQL Server Management Studio 11.0.3000.0
Microsoft Analysis Services Client Tools 11.0.3000.0
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.9600.17843
Microsoft .NET Framework 4.0.30319.18408
Operating System 6.1.7601

i tried
TSQLServer *db = TSQLServer::Connect(“sqlserver://db_dev/operation”, “”, “”);
I get

ROOT 5.34/32 (v5-34-32@v5-34-32, Jun 23 2015, 17:58:02 on win32)
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
root [1] .x sqlTestSor.C
Error: illegal pointer to class object db 0x0 1960 C:\rootFiles\VesselPar\rootRoot\sqlTestSor.C(14)
*** Interpreter error recovered ***
root [2]

<if i simply write mysql
i get this error.

root [1] .x sqlTestSor.C
Error in TWinNTSystem::DynamicPathName: RMySQL does not exist in c:\root_v5.34.32\bin;c:\root_v5.34.32\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0;C:\Program Files (x86)\MSBuild\12.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Enterprise Vault
EVClient\x64;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;.;c:\root_v5.34.32/bin;c:\root_v5.34.32/lib;c:\root_v5.34.32/cint/cint/stl;c:\root_v5.34.32\bin,
or has wrong file extension (.dll)
Error: illegal pointer to class object db 0x0 1960 C:\rootFiles\VesselPar\rootRoot\sqlTestSor.C(14)
*** Interpreter error recovered ***
root [2]

Try:
root-config --features
and see if you have “mysql” (MySQL support) and/or “odbc” (ODBC support) and/or “oracle” (Oracle support) and/or “pgsql” (PostgreSQL support) and/or “sapdb” (MaxDB/SapDB support) and/or “sqlite” (SQLite support) in the returned string.

On Windows, you cannot run the “root-config” script but you can still look into the “${ROOTSYS}/bin/root-config” file (it’s a simple text file) and search for the line which begins with “features=”.

i know is a stupid question, but how do i run the root-config from a windows terminal :frowning: .

Try to ping “bellenot” (and/or “Axel”) for further help.

thanks. i ping, but no answer. I look at the following link
root.cern.ch/root/html534/TSQLServer.html
i tried some combination of names but i have always the same error message, cannot get the name of the database

If you want to use ODBC then have a look at the old [url=https://root-forum.cern.ch/t/odbc-access-with-win32/3242/1 access with Win32"[/url] thread and at the TODBCServer plugin description (it comes from an old ROOT 5.18 version and I don’t know why this plugin description is missing in newer versions but you can still have a look at the “/root_source_code/sql/odbc/src/TODBCServer.cxx” file and you can also directly contact “linev” who is the author of this code).

Hi
Is working in the end with the odbcd see below the example how to look at the first ten lines;

#ifndef CINT
#include <TSQLServer.h>
#include <TSQLResult.h>
#include <TSQLRow.h>
#endif

void sqlTestSor()
{
TSQLServer *srv = TSQLServer::Connect(“odbcd://DRIVER={SQL Server};SERVER=servername;DATABASE=databasename;Integrated Security=True;”, 0, 0);

TSQLResult* res = srv->Query("SELECT top 10 * FROM tablename order by daterec desc");
TSQLRow* row = 0;
TList lst;

etc…
}

thanks
sor