ROOT  6.06/09
Reference Guide
Macros | Functions
TODBCServer.cxx File Reference
#include "TODBCServer.h"
#include "TODBCRow.h"
#include "TODBCResult.h"
#include "TODBCStatement.h"
#include "TSQLColumnInfo.h"
#include "TSQLTableInfo.h"
#include "TUrl.h"
#include "TString.h"
#include "TObjString.h"
#include "TList.h"
#include "Riostream.h"
#include <sqlext.h>
+ Include dependency graph for TODBCServer.cxx:

Go to the source code of this file.

Macros

#define CheckConnect(method, res)
 
#define STR_LEN   128+1
 
#define REM_LEN   254+1
 

Functions

 ClassImp (TODBCServer) TODBCServer
 Open a connection to a ODBC server. More...
 

Macro Definition Documentation

#define CheckConnect (   method,
  res 
)
#define REM_LEN   254+1
#define STR_LEN   128+1

Function Documentation

ClassImp ( TODBCServer  )

Open a connection to a ODBC server.

The db arguments can be:

  1. Form "odbc://[user[:passwd]@]<host>[:<port>][/<database>][?Driver]", e.g.: "odbc://pcroot.cern.ch:3306/test?MySQL". Driver argument specifies ODBC driver, which should be used for connection. By default, MyODBC driver name is used. The uid is the username and pw the password that should be used for the connection. If uid and pw are not specified (==0), user and passwd arguments from URL will be used. Works only with MySQL ODBC, probably with PostrSQL ODBC.
  2. Form "odbcd://DRIVER={MyODBC};SERVER=pcroot.cern.ch;DATABASE=test;USER=user;PASSWORD=pass;OPTION=3;PORT=3306;" This is a form, which is accepted by SQLDriverConnect function of ODBC. Here some other arguments can be specified, which are not included in standard URL format.
  3. Form "odbcn://MySpecialConfig", where MySpecialConfig is entry, defined in user DSN (user data source). Here uid and pw should be always specified.

    Configuring unixODBC under Linux: http://www.unixodbc.org/odbcinst.html Remarks: for variants 1 & 2 it is enough to create/configure odbcinst.ini file. For variant 3 file odbc.ini should be created. Path to this files can be specified in environmental variables like export ODBCINI=/home/my/unixODBC/etc/odbc.ini export ODBCSYSINI=/home/my/unixODBC/etc

    Configuring MySQL ODBC under Windows. Installing ODBC driver for MySQL is enough to use it under Windows. Afer odbcd:// variant can be used with DRIVER={MySQL ODBC 3.51 Driver}; To configure User DSN, go into Start menu -> Settings -> Control panel -> Administrative tools-> Data Sources (ODBC).

    To install Oracle ODBC driver for Windows, one should download and install either complete Oracle client (~500 MB), or so-called Instant Client Basic and Instant Client ODBC (~20 MB together). Some remark about Instant Client: 1) Two additional DLLs are required: mfc71.dll & msver71.dll They can be found either in MS VC++ 7.1 Free Toolkit or downloaded from other Internet sites 2) ORACLE_HOME environment variable should be specified and point to location, where Instant Client files are extracted 3) Run odbc_install.exe from account with administrative rights 3) In $ORACLE_HOME/network/admin/ directory appropriate *.ora files like ldap.ora, sqlnet.ora, tnsnames.ora should be installed. Contact your Oracle administrator to get these files. After Oracle ODBC driver is installed, appropriate entry in ODBC drivers list like "Oracle in instantclient10_2" should appiar. Connection string example: "odbcd://DRIVER={Oracle in instantclient10_2};DBQ=db-test;UID=user_name;PWD=user_pass;";

Definition at line 29 of file TODBCServer.cxx.