Public Member Functions | |
NSql (void) | |
Constructs a NSql object. | |
NSql (const NString &user, const NString &pass, const NHostAddress &host) | |
Constructs a NSql object. | |
NSql (const NString &user, const NString &pass, const NHostAddress &host, nint16 port) | |
Constructs a NSql object. | |
virtual | ~NSql (void) |
Destroys a NSql object. | |
virtual void | setUser (const NString &user) |
Sets the database user. | |
virtual void | setPassword (const NString &pass) |
Sets the database password. | |
virtual void | setHost (const NHostAddress &host) |
Sets the database host. | |
virtual void | setPort (nint16 port) |
Sets the database port. | |
virtual void | setDatabase (const NString &database) |
Sets the database name. | |
virtual NString | getUser (void) const |
Gets the database user. | |
virtual NString | getPassword (void) const |
Gets the database password. | |
virtual NHostAddress | getHost (void) const |
Gets the database host. | |
virtual nint16 | getPort (void) const |
Gets the database port. | |
virtual NString | getDatabase (void) const |
Gets the database name. | |
virtual void | connectToHost (void)=0 |
Connects to the database host. | |
virtual void | disconnectFromHost (void)=0 |
Disconnects from the database host. | |
virtual bool | execSql (const NSqlQuery &query)=0 |
Executes a SQL query identified by query. | |
virtual NSqlRecord * | getNext (void)=0 |
Gets the next record in the record set. | |
virtual NSqlRecord * | getPrevious (void)=0 |
Gets the previous record in the record set. | |
virtual NSqlRecord * | getFirst (void)=0 |
Gets the first record in the record set. | |
virtual NSqlRecord * | getLast (void)=0 |
Gets the last record in the record set. | |
virtual NString | getError (void) const =0 |
Gets the last error from the database. | |
Protected Member Functions | |
void | setRecordData (NSqlRecord *record, const NString &rowName, const NVtype &rowData) |
Protected Attributes | |
NString | m_user |
NString | m_password |
NHostAddress | m_host |
nint16 | m_port |
NString | m_database |
Definition at line 40 of file nsql.h.
NSql | ( | const NString & | user, | |
const NString & | pass, | |||
const NHostAddress & | host | |||
) |
NSql | ( | const NString & | user, | |
const NString & | pass, | |||
const NHostAddress & | host, | |||
nint16 | port | |||
) |
void setUser | ( | const NString & | user | ) | [virtual] |
void setPassword | ( | const NString & | pass | ) | [virtual] |
void setHost | ( | const NHostAddress & | host | ) | [virtual] |
Sets the database host.
host | Database host (i.e.: host where the database is running) |
Definition at line 81 of file nsql.cpp.
References NDebug::print().
void setPort | ( | nint16 | port | ) | [virtual] |
Sets the database port.
port | Database port |
Definition at line 87 of file nsql.cpp.
References NException::DBAL, and NDebug::print().
void setDatabase | ( | const NString & | database | ) | [virtual] |
NString getUser | ( | void | ) | const [virtual] |
NString getPassword | ( | void | ) | const [virtual] |
NHostAddress getHost | ( | void | ) | const [virtual] |
nint16 getPort | ( | void | ) | const [virtual] |
NString getDatabase | ( | void | ) | const [virtual] |
virtual bool execSql | ( | const NSqlQuery & | query | ) | [pure virtual] |
Executes a SQL query identified by query.
query | SQL query |
Implemented in NMySql.
virtual NSqlRecord* getNext | ( | void | ) | [pure virtual] |
Gets the next record in the record set.
Implemented in NMySql.
virtual NSqlRecord* getPrevious | ( | void | ) | [pure virtual] |
Gets the previous record in the record set.
Implemented in NMySql.
virtual NSqlRecord* getFirst | ( | void | ) | [pure virtual] |
Gets the first record in the record set.
Implemented in NMySql.
virtual NSqlRecord* getLast | ( | void | ) | [pure virtual] |
Gets the last record in the record set.
Implemented in NMySql.
virtual NString getError | ( | void | ) | const [pure virtual] |
Gets the last error from the database.
Implemented in NMySql.