NMySql Class Reference

Base class for connecting to a MySQL database. More...

Inheritance diagram for NMySql:

NSql NObject

List of all members.

Public Member Functions

 NMySql (const NString &user, const NString &pass, const NHostAddress &host)
 NMySql (const NString &user, const NString &pass, const NHostAddress &host, nint16 port)
void connectToHost (void)
 Connects to the database host.
void disconnectFromHost (void)
 Disconnects from the database host.
bool execSql (const NSqlQuery &query)
 Executes a SQL query identified by query.
NSqlRecordgetNext (void)
 Gets the next record in the record set.
NSqlRecordgetPrevious (void)
 Gets the previous record in the record set.
NSqlRecordgetFirst (void)
 Gets the first record in the record set.
NSqlRecordgetLast (void)
 Gets the last record in the record set.
NString getError (void) const
 Gets the last error from the database.


Detailed Description

Base class for connecting to a MySQL database.

See also:
NSql for documentation
Examples:

nsqlapp.cpp.

Definition at line 50 of file nmysql.h.


Member Function Documentation

bool execSql ( const NSqlQuery query  )  [virtual]

Executes a SQL query identified by query.

Parameters:
query SQL query
Returns:
true in case of success or false otherwise

Implements NSql.

Definition at line 341 of file nmysql.cpp.

References NException::DBAL, NSqlQuery::get(), NDebug::print(), and NString::toChar().

NSqlRecord * getNext ( void   )  [virtual]

Gets the next record in the record set.

Returns:
The next record in the record set or NULL if not existant

Implements NSql.

Definition at line 432 of file nmysql.cpp.

References NList::at(), NDebug::print(), and NList::size().

NSqlRecord * getPrevious ( void   )  [virtual]

Gets the previous record in the record set.

Returns:
The previous record in the record set or NULL if not existant

Implements NSql.

Definition at line 447 of file nmysql.cpp.

References NList::at().

NSqlRecord * getFirst ( void   )  [virtual]

Gets the first record in the record set.

Returns:
The first record in the record set or NULL if not existant

Implements NSql.

Definition at line 458 of file nmysql.cpp.

References NList::at(), and NList::size().

NSqlRecord * getLast ( void   )  [virtual]

Gets the last record in the record set.

Returns:
The last record in the record set or NULL if not existant

Implements NSql.

Definition at line 470 of file nmysql.cpp.

References NList::last().

NString getError ( void   )  const [virtual]

Gets the last error from the database.

Returns:
The last error from the database

Implements NSql.

Definition at line 70 of file nmysql.cpp.

References NHostAddress::toString().

Referenced by connectToHost().


The documentation for this class was generated from the following files:
Generated on Wed Mar 5 23:10:37 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4