sprint 1-alpha
Public Member Functions
sprint::odbc Class Reference

Un Wrapper C++ verso ODBC. More...

#include <odbc.h>

List of all members.

Public Member Functions

bool connect (const char *provider, const char *username, const char *password)
bool connect (const char *InConnectionString)
bool disconnect ()
 Disconnect before new connection.
bool begin_query (const char *query)
void end_query ()
 Termina una query.
bool next ()
template<class T >
bool get (unsigned int col, T *value)
bool get (unsigned int col, char *buf, unsigned int buf_len)
bool good () const
 La connessione e' valida?

Detailed Description

Un Wrapper C++ verso ODBC.


Member Function Documentation

bool sprint::odbc::begin_query ( const char *  query)

Inizia una query

Note:
mutex: nessun altro thread tra una query e l'EndQuery puo' fare un'altra richiesta
 BeginQuery("SELECT");
bool sprint::odbc::connect ( const char *  provider,
const char *  username,
const char *  password 
)

Connect using SQLConnect

 db.connect("DNS","USERNAME","PASSWORD");
bool sprint::odbc::connect ( const char *  InConnectionString)

Connnect using SQLDriverConnect

 // connessione a DB Access
 db.connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\\pippo.mdb;");
 // connessione a DB SQL
 db.connect("TODO");
bool sprint::odbc::get ( unsigned int  col,
char *  buf,
unsigned int  buf_len 
)

Ritorna la colonna col per un buffer di testo

Parameters:
colcolonna
bufun buffer da riempire
buf_lenla dimensione del buffer
template<class T >
bool sprint::odbc::get ( unsigned int  col,
T *  value 
)

Ritorna la colonna col

Parameters:
colcolonna del record
valuepuntatore a un valore da riempire
Note:
solo i tipi implementati sono ritornati. Altrimenti semplicemente non linka T puo' essere: long, int, unsigned long, unsigned int, float, double
bool sprint::odbc::next ( )

Avanza al prossimo record della query

Returns:
false se non ci sono piu' record disponibili

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines