Difference between revisions of "OpenDBX/C++ API/1.0/Conn"

From Linuxnetworks
< OpenDBX‎ | C++ API‎ | 1.0
Jump to: navigation, search
(Conn public members)
 
(No difference)

Revision as of 23:07, 18 March 2009

Public member functions

Conn(
   const Conn &ref
) throw ()

Copy constructor.

Conn(
   const string &backend,
   const string &host=,
   const string &port=
) throw ( std::exception )

Creates a connection object using C++ style string parameters.

Conn(
   const char *backend,
   const char *host=,
   const char *port=
) throw ( std::exception )

Creates a connection object using C style string parameters.

Conn() throw () 

The default constructor for newly created connection objects without parameters.

~Conn() throw () 

Destroys the connection instance if no other references exist.

void bind(
   const string &database,
   const string &who=,
   const string &cred=,
   odbxbind method=ODBX_BIND_SIMPLE
) throw ( std::exception )

Authenticates the user and selects the database using C++ style string parameters.

void bind(
   const char *database,
   const char *who=,
   const char *cred=,
   odbxbind method=ODBX_BIND_SIMPLE
) throw ( std::exception )

Authenticates the user and selects the database using C style string parameters.

Stmt create(
   const string &sql,
   Stmt::Type type=Stmt::Simple
) throw ( std::exception )

Creates a statement object from a SQL text string using a C++ string.

Stmt create(
   const char *sql,
   unsigned long size=0,
   Stmt::Type type=Stmt::Simple
) throw ( std::exception )

Creates a statement object from a SQL text string using a C style buffer.

string & escape(
   const string &from,
   string &to
) throw ( std::exception )

Escapes potentially dangerous characters in user input using a C++ style string parameter.

string & escape(
   const char *from,
   unsigned long fromlen,
   string &to
) throw ( std::exception )

Escapes potentially dangerous characters in user input using a C style buffer.

void finish() throw ( std::exception )

Cleans up the connection object.

bool getCapability(
   odbxcap cap
) throw ( std::exception )

Tests if the database driver module does understand certain extensions.

void getOption(
   odbxopt option,
   void *value
) throw ( std::exception )

Gets the value of a certain option provided by the database driver module.

Conn & operator=(
   const Conn &ref
) throw ()

Assigns a connection instance to another one.

void setOption(
   odbxopt option,
   void *value
) throw ( std::exception )

Sets a certain option provided by the database driver module.

void unbind() throw ( std::exception )

Releases the connection to the database and resets the authentication status.