NSql Class Reference

Base class for SQL manipulation. More...

Inheritance diagram for NSql:

NObject NMySql

List of all members.

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 NSqlRecordgetNext (void)=0
 Gets the next record in the record set.
virtual NSqlRecordgetPrevious (void)=0
 Gets the previous record in the record set.
virtual NSqlRecordgetFirst (void)=0
 Gets the first record in the record set.
virtual NSqlRecordgetLast (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


Detailed Description

Base class for SQL manipulation.

Definition at line 40 of file nsql.h.


Constructor & Destructor Documentation

NSql ( const NString user,
const NString pass,
const NHostAddress host 
)

Constructs a NSql object.

Parameters:
user Database user
pass Database password
host Database host (i.e.: host where the database is running)

Definition at line 40 of file nsql.cpp.

NSql ( const NString user,
const NString pass,
const NHostAddress host,
nint16  port 
)

Constructs a NSql object.

Parameters:
user Database user
pass Database password
host Database host (i.e.: host where the database is running)
port Database port

Definition at line 53 of file nsql.cpp.


Member Function Documentation

void setUser ( const NString user  )  [virtual]

Sets the database user.

Parameters:
user Database user

Definition at line 71 of file nsql.cpp.

void setPassword ( const NString pass  )  [virtual]

Sets the database password.

Parameters:
pass Database password

Definition at line 76 of file nsql.cpp.

void setHost ( const NHostAddress host  )  [virtual]

Sets the database host.

Parameters:
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.

Parameters:
port Database port

Definition at line 87 of file nsql.cpp.

References NException::DBAL, and NDebug::print().

void setDatabase ( const NString database  )  [virtual]

Sets the database name.

Parameters:
database Database name

Definition at line 101 of file nsql.cpp.

NString getUser ( void   )  const [virtual]

Gets the database user.

Returns:
Database user

Definition at line 106 of file nsql.cpp.

NString getPassword ( void   )  const [virtual]

Gets the database password.

Returns:
Database password

Definition at line 110 of file nsql.cpp.

NHostAddress getHost ( void   )  const [virtual]

Gets the database host.

Returns:
Database host (i.e.: host where the database is running)

Definition at line 114 of file nsql.cpp.

nint16 getPort ( void   )  const [virtual]

Gets the database port.

Returns:
Database port

Definition at line 118 of file nsql.cpp.

NString getDatabase ( void   )  const [virtual]

Gets the database name.

Returns:
The database name

Definition at line 122 of file nsql.cpp.

virtual bool execSql ( const NSqlQuery query  )  [pure virtual]

Executes a SQL query identified by query.

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

Implemented in NMySql.

virtual NSqlRecord* getNext ( void   )  [pure virtual]

Gets the next record in the record set.

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

Implemented in NMySql.

virtual NSqlRecord* getPrevious ( void   )  [pure virtual]

Gets the previous record in the record set.

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

Implemented in NMySql.

virtual NSqlRecord* getFirst ( void   )  [pure virtual]

Gets the first record in the record set.

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

Implemented in NMySql.

virtual NSqlRecord* getLast ( void   )  [pure virtual]

Gets the last record in the record set.

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

Implemented in NMySql.

virtual NString getError ( void   )  const [pure virtual]

Gets the last error from the database.

Returns:
The last error from the database

Implemented in NMySql.


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