Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

sptkSQLDatabase Class Reference

#include <sptksqldatabase.h>

Inheritance diagram for sptkSQLDatabase:

sptkObject List of all members.

Public Member Functions

virtual int changeUser (std::string user, std::string passwd="", std::string database="")
virtual void close ()
virtual int connect (std::string server, std::string user, std::string passwd, std::string database="", int flags=0)
virtual int createDB (std::string database)
virtual sptkSQLResultquery (std::string queryString)
virtual int drop (std::string name)
virtual std::string error ()
virtual std::string * listDBs (std::string wildcard="")
virtual std::string * listTables (std::string wildcard="")
virtual int selectDB (std::string database)

Detailed Description

Author:
Sven Broenstrup


Member Function Documentation

virtual int sptkSQLDatabase::changeUser std::string    user,
std::string    passwd = "",
std::string    database = ""
[virtual]
 

Change user logged in on active connection; call after connect() only.

Parameters:
user Name of the new user.
passwd Password for the user.
Default is "".
database Change database to work on if it not equals "".
Default is "".

virtual void sptkSQLDatabase::close   [virtual]
 

Close active SQL connection; Connection closed by destructor if not persistent.

virtual int sptkSQLDatabase::connect std::string    server,
std::string    user,
std::string    passwd,
std::string    database = "",
int    flags = 0
[virtual]
 

Open a connection to a SQL Server

Parameters:
server Adress and optionally port of SQL-Server.
user Name of user to connect.
passwd Password to connect.
database Database to be used on connected server, "" for no database at startup Default is "".
flags Flags vor the SQL-Connection [for future use].
Default is 0.
Returns:
Errorcode; 0 for no error.

virtual int sptkSQLDatabase::createDB std::string    database [virtual]
 

Create a SQL database

Parameters:
database Name of new database
Returns:
Errorcode; 0 for no error.

virtual int sptkSQLDatabase::drop std::string    name [virtual]
 

Send a SQL query

Parameters:
name Name of database to drop.
Returns:
Errorcode; 0 for no error.

virtual std::string sptkSQLDatabase::error   [virtual]
 

Returns the text of the error message from previous SQL operation.

Returns:
Text of error message.

virtual std::string* sptkSQLDatabase::listDBs std::string    wildcard = "" [virtual]
 

List databases available on actual SQL server.

Parameters:
wildcard Return only databases that match the wildcard. If "" do not filter.
Default is "".
Returns:
List of databases on actual SQL server

virtual std::string* sptkSQLDatabase::listTables std::string    wildcard = "" [virtual]
 

List tables in a SQL database

Parameters:
wildcard Return only tables that match the wildcard. If "" do not filter.
Default is "".
Returns:
List of tables in database given.

virtual sptkSQLResult* sptkSQLDatabase::query std::string    queryString [virtual]
 

Send a SQL query to the database

Parameters:
queryString Result of query operation performed

virtual int sptkSQLDatabase::selectDB std::string    database [virtual]
 

Select a MySQL database

Returns:
Errorcode; 0 for no error.


The documentation for this class was generated from the following file:
Powered by SPOM