MySQL_Connector Class Reference

Class uses the mysql C api to connect to a remote database. More...

#include <mysql_connector.h>

List of all members.

Public Member Functions

void create (string host, string user, string passwd, string db)
 The base function for the constructor.
void query (string sql_query)
 Sends a query to the server.
void get_data (bool store_local_copy, Vector *v)
 Puts the result of a single field query into a Vector.
void get_time_series (TimeSeries &ts, bool get_returns)
 Puts the results of an time series sql query into a distributed TimeSeries.

Private Attributes

MYSQL mysql
MYSQL_RES * mysql_result
int core_id
int num_cores
int num_fields
int num_local_fields
int num_rows
int num_local_rows


Detailed Description

Class uses the mysql C api to connect to a remote database.

Member Function Documentation

void MySQL_Connector::create ( string  host,
string  user,
string  passwd,
string  db 
)

The base function for the constructor.

Parameters:
host :The host/server name.
user :The user name.
passwd :The user's password.
db :The database name.

void MySQL_Connector::query ( string  sql_query  ) 

Sends a query to the server.

Parameters:
sql_query : Query using mysql syntax.

void MySQL_Connector::get_data ( bool  store_local_copy,
Vector *  v 
)

Puts the result of a single field query into a Vector.

Parameters:
store_local_copy : True stores a copy of the entire query result on each core.
d_vec : The distributed Vector to store the data.
This function needs a Vector that has already been created. The Vector must be large enough to store the result. Run a separate mysql query count to get the correct size.

void MySQL_Connector::get_time_series ( TimeSeries ts,
bool  get_returns 
)

Puts the results of an time series sql query into a distributed TimeSeries.

Parameters:
ts : An allocated TimeSeries.
get_returns : Computes a return series if true, otherwise gets the raw data.


Member Data Documentation

MYSQL MySQL_Connector::mysql [private]

MYSQL_RES* MySQL_Connector::mysql_result [private]

int MySQL_Connector::core_id [private]


The documentation for this class was generated from the following files:

Documentation generated by  doxygen
Source code hosted by