libodbc++
0.2.5
|
A result set. More...
#include <resultset.h>
Public Types | |
enum | { CONCUR_READ_ONLY, CONCUR_UPDATABLE } |
ResultSet concurrency constants. More... | |
enum | { TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE } |
ResultSet type constants. More... | |
Public Member Functions | |
virtual | ~ResultSet () |
Destructor. | |
bool | absolute (int row) |
Moves the cursor to a specific row in this result set. More... | |
bool | relative (int rows) |
Moves the cursor inside the result set relative to the current row. More... | |
void | afterLast () |
Places the cursor after the last row in the result set. | |
void | beforeFirst () |
Places the cursor before the first row in the result set. | |
bool | isAfterLast () |
Checks if the cursor is after the last row in the result set. | |
bool | isBeforeFirst () |
Checks if the cursor is before the first row in the result set. | |
bool | isFirst () |
Checks if the cursor is on the first row in the result set. | |
bool | isLast () |
Checks if the cursor is on the last row in the result set. | |
int | getRow () |
Returns the current row number. More... | |
bool | next () |
Moves to the next row in the result set. More... | |
bool | previous () |
Moves to the previous row in the result set. More... | |
bool | first () |
Moves to the first row in the result set. More... | |
bool | last () |
Moves to the last row in the result set. More... | |
void | moveToInsertRow () |
Moves the cursor to the 'insert row' of this result set. More... | |
void | moveToCurrentRow () |
Moves the cursor back to where it was before it was moved to the insert row. | |
void | refreshRow () |
Refreshes the current row. | |
void | deleteRow () |
Deletes the current row. | |
void | insertRow () |
Inserts the current row. More... | |
void | updateRow () |
Updates the current row. More... | |
void | cancelRowUpdates () |
Cancels any updates done to the current row. | |
ResultSetMetaData * | getMetaData () |
Returns meta data about this result set. More... | |
int | findColumn (const std::string &colName) |
Find a column index by the column's name. | |
bool | rowDeleted () |
Checks if the current row is deleted. | |
bool | rowInserted () |
Checks if the current row was inserted. | |
bool | rowUpdated () |
Checks if the current row was updated. | |
int | getType () |
Gets the type of this result set. | |
int | getConcurrency () |
Gets the concurrency of this result set. | |
int | getFetchSize () |
Gets this result set's current fetch size. | |
void | setFetchSize (int fetchSize) |
Sets this result set's fetch size (doesn't apply immediately) | |
std::string | getCursorName () |
Gets the cursor name associated with this result set. | |
Statement * | getStatement () |
Gets the Statement that created this result set. | |
double | getDouble (int idx) |
Gets a column's value as a double. More... | |
bool | getBoolean (int idx) |
Gets a column's value as a bool. More... | |
signed char | getByte (int idx) |
Gets a column's value as a signed char. More... | |
Bytes | getBytes (int idx) |
Gets a column's value as a chunk of bytes. More... | |
Date | getDate (int idx) |
Gets a column's value as a Date. More... | |
float | getFloat (int idx) |
Gets a column's value as a float. More... | |
int | getInt (int idx) |
Gets a column's value as an int. More... | |
Long | getLong (int idx) |
Gets a column's value as a Long. More... | |
short | getShort (int idx) |
Gets a column's value as a short. More... | |
std::string | getString (int idx) |
Gets a column's value as a string. More... | |
Time | getTime (int idx) |
Gets a column's value as a Time. More... | |
Timestamp | getTimestamp (int idx) |
Gets a column's value as a Timestamp. More... | |
double | getDouble (const std::string &colName) |
Gets a column's value as a double. More... | |
bool | getBoolean (const std::string &colName) |
Gets a column's value as a bool. More... | |
signed char | getByte (const std::string &colName) |
Gets a column's value as a signed char. More... | |
Bytes | getBytes (const std::string &colName) |
Gets a column's value as a chunk of bytes. More... | |
Date | getDate (const std::string &colName) |
Gets a column's value as a Date. More... | |
float | getFloat (const std::string &colName) |
Gets a column's value as a float. More... | |
int | getInt (const std::string &colName) |
Gets a column's value as an int. More... | |
Long | getLong (const std::string &colName) |
Gets a column's value as a Long. More... | |
short | getShort (const std::string &colName) |
Gets a column's value as a short. More... | |
std::string | getString (const std::string &colName) |
Gets a column's value as a string. More... | |
Time | getTime (const std::string &colName) |
Gets a column's value as a Time. More... | |
Timestamp | getTimestamp (const std::string &colName) |
Gets a column's value as a Timestamp. More... | |
std::istream * | getAsciiStream (int idx) |
Fetches a column's value as a stream. More... | |
std::istream * | getAsciiStream (const std::string &colName) |
Fetches a column's value as a stream. More... | |
std::istream * | getBinaryStream (int idx) |
Fetches a column's value as a stream. More... | |
std::istream * | getBinaryStream (const std::string &colName) |
Fetches a column's value as a stream. More... | |
bool | wasNull () |
Checks if the last fetched column value was NULL. More... | |
void | updateDouble (int idx, double val) |
Sets the value of a column to a double. More... | |
void | updateBoolean (int idx, bool val) |
Sets the value of a column to a bool. More... | |
void | updateByte (int idx, signed char val) |
Sets the value of a column to a signed char. More... | |
void | updateBytes (int idx, const Bytes &val) |
Sets the value of a column to a chunk of bytes. More... | |
void | updateDate (int idx, const Date &val) |
Sets the value of a column to a Date. More... | |
void | updateFloat (int idx, float val) |
Sets the value of a column to a float. More... | |
void | updateInt (int idx, int val) |
Sets the value of a column to an int. More... | |
void | updateLong (int idx, Long val) |
Sets the value of a column to a Long. More... | |
void | updateShort (int idx, short val) |
Sets the value of a column to a short. More... | |
void | updateString (int idx, const std::string &val) |
Sets the value of a column to a string. More... | |
void | updateTime (int idx, const Time &val) |
Sets the value of a column to a Time. More... | |
void | updateTimestamp (int idx, const Timestamp &val) |
Sets the value of a column to a Timestamp. More... | |
void | updateNull (int idx) |
Sets the value of a column to NULL. More... | |
void | updateDouble (const std::string &colName, double val) |
Sets the value of a column to a double. More... | |
void | updateBoolean (const std::string &colName, bool val) |
Sets the value of a column to a bool. More... | |
void | updateByte (const std::string &colName, signed char val) |
Sets the value of a column to a signed char. More... | |
void | updateBytes (const std::string &colName, const Bytes &val) |
Sets the value of a column to a chunk of bytes. More... | |
void | updateDate (const std::string &colName, const Date &val) |
Sets the value of a column to a Date. More... | |
void | updateFloat (const std::string &colName, float val) |
Sets the value of a column to a float. More... | |
void | updateInt (const std::string &colName, int val) |
Sets the value of a column to an int. More... | |
void | updateLong (const std::string &colName, Long val) |
Sets the value of a column to a Long. More... | |
void | updateShort (const std::string &colName, short val) |
Sets the value of a column to a short. More... | |
void | updateString (const std::string &colName, const std::string &val) |
Sets the value of a column to a string. More... | |
void | updateTime (const std::string &colName, const Time &val) |
Sets the value of a column to a Time. More... | |
void | updateTimestamp (const std::string &colName, const Timestamp &val) |
Sets the value of a column to a Timestamp. More... | |
void | updateAsciiStream (int idx, std::istream *s, int len) |
Sets the value of a column to a stream. More... | |
void | updateAsciiStream (const std::string &colName, std::istream *s, int len) |
Sets the value of a column to the contens of a stream. More... | |
void | updateBinaryStream (int idx, std::istream *s, int len) |
Sets the value of a column to the contens of a stream. More... | |
void | updateBinaryStream (const std::string &colName, std::istream *s, int len) |
Sets the value of a column to the contens of a stream. More... | |
void | updateNull (const std::string &colName) |
Sets the value of a column to NULL. More... | |
![]() | |
void | clearWarnings () |
Clears all the warnings stored in this object. | |
WarningList * | getWarnings () |
Fetches all the warnings in this object. More... | |
virtual | ~ErrorHandler () |
Destructor. | |
Additional Inherited Members | |
![]() | |
ErrorHandler (bool collectWarnings=true) | |
Constructor. | |
A result set.
anonymous enum |
anonymous enum |
ResultSet type constants.
bool odbc::ResultSet::absolute | ( | int | row | ) |
Moves the cursor to a specific row in this result set.
If row is negative, the actual row number is calculated from the end of the result set. Calling absolute(0)
is equivalent to calling beforeFirst()
bool odbc::ResultSet::first | ( | ) |
Moves to the first row in the result set.
std::istream* odbc::ResultSet::getAsciiStream | ( | int | idx | ) |
Fetches a column's value as a stream.
Note that the stream is owned by the result set and should in no case be deleted by the caller. Also, the returned stream is only valid while the cursor remains on this position.
idx | The column index, starting at 1 |
std::istream* odbc::ResultSet::getAsciiStream | ( | const std::string & | colName | ) |
Fetches a column's value as a stream.
Note that the stream is owned by the result set and should in no case be deleted by the caller. Also, the returned stream is only valid while the cursor remains on this position.
colName | The column name |
std::istream* odbc::ResultSet::getBinaryStream | ( | int | idx | ) |
Fetches a column's value as a stream.
Note that the stream is owned by the result set and should in no case be deleted by the caller. Also, the returned stream is only valid while the cursor remains on this position.
idx | The column index, starting at 1 |
std::istream* odbc::ResultSet::getBinaryStream | ( | const std::string & | colName | ) |
Fetches a column's value as a stream.
Note that the stream is owned by the result set and should in no case be deleted by the caller. Also, the returned stream is only valid while the cursor remains on this position.
colName | The column name |
bool odbc::ResultSet::getBoolean | ( | int | idx | ) |
Gets a column's value as a bool.
idx | The column index, starting at 1 |
bool odbc::ResultSet::getBoolean | ( | const std::string & | colName | ) |
Gets a column's value as a bool.
colName | The name of the column |
signed char odbc::ResultSet::getByte | ( | int | idx | ) |
Gets a column's value as a signed char.
idx | The column index, starting at 1 |
signed char odbc::ResultSet::getByte | ( | const std::string & | colName | ) |
Gets a column's value as a signed char.
colName | The name of the column |
Bytes odbc::ResultSet::getBytes | ( | int | idx | ) |
Gets a column's value as a chunk of bytes.
idx | The column index, starting at 1 |
Bytes odbc::ResultSet::getBytes | ( | const std::string & | colName | ) |
Gets a column's value as a chunk of bytes.
colName | The name of the column |
Date odbc::ResultSet::getDate | ( | int | idx | ) |
Gets a column's value as a Date.
idx | The column index, starting at 1 |
Date odbc::ResultSet::getDate | ( | const std::string & | colName | ) |
Gets a column's value as a Date.
colName | The name of the column |
double odbc::ResultSet::getDouble | ( | int | idx | ) |
Gets a column's value as a double.
idx | The column index, starting at 1 |
double odbc::ResultSet::getDouble | ( | const std::string & | colName | ) |
Gets a column's value as a double.
colName | The name of the column |
float odbc::ResultSet::getFloat | ( | int | idx | ) |
Gets a column's value as a float.
idx | The column index, starting at 1 |
float odbc::ResultSet::getFloat | ( | const std::string & | colName | ) |
Gets a column's value as a float.
colName | The name of the column |
int odbc::ResultSet::getInt | ( | int | idx | ) |
Gets a column's value as an int.
idx | The column index, starting at 1 |
int odbc::ResultSet::getInt | ( | const std::string & | colName | ) |
Gets a column's value as an int.
colName | The name of the column |
Long odbc::ResultSet::getLong | ( | int | idx | ) |
Gets a column's value as a Long.
idx | The column index, starting at 1 |
Long odbc::ResultSet::getLong | ( | const std::string & | colName | ) |
Gets a column's value as a Long.
colName | The name of the column |
ResultSetMetaData* odbc::ResultSet::getMetaData | ( | ) |
Returns meta data about this result set.
int odbc::ResultSet::getRow | ( | ) |
Returns the current row number.
0
if it can't be determined. short odbc::ResultSet::getShort | ( | int | idx | ) |
Gets a column's value as a short.
idx | The column index, starting at 1 |
short odbc::ResultSet::getShort | ( | const std::string & | colName | ) |
Gets a column's value as a short.
colName | The name of the column |
std::string odbc::ResultSet::getString | ( | int | idx | ) |
Gets a column's value as a string.
idx | The column index, starting at 1 |
std::string odbc::ResultSet::getString | ( | const std::string & | colName | ) |
Gets a column's value as a string.
colName | The name of the column |
Time odbc::ResultSet::getTime | ( | int | idx | ) |
Gets a column's value as a Time.
idx | The column index, starting at 1 |
Time odbc::ResultSet::getTime | ( | const std::string & | colName | ) |
Gets a column's value as a Time.
colName | The name of the column |
Timestamp odbc::ResultSet::getTimestamp | ( | int | idx | ) |
Gets a column's value as a Timestamp.
idx | The column index, starting at 1 |
Timestamp odbc::ResultSet::getTimestamp | ( | const std::string & | colName | ) |
Gets a column's value as a Timestamp.
colName | The name of the column |
void odbc::ResultSet::insertRow | ( | ) |
bool odbc::ResultSet::last | ( | ) |
Moves to the last row in the result set.
void odbc::ResultSet::moveToInsertRow | ( | ) |
Moves the cursor to the 'insert row' of this result set.
bool odbc::ResultSet::next | ( | ) |
Moves to the next row in the result set.
bool odbc::ResultSet::previous | ( | ) |
Moves to the previous row in the result set.
bool odbc::ResultSet::relative | ( | int | rows | ) |
Moves the cursor inside the result set relative to the current row.
Negative values are allowed. This call is illegal if there is no current row.
void odbc::ResultSet::updateAsciiStream | ( | int | idx, |
std::istream * | s, | ||
int | len | ||
) |
Sets the value of a column to a stream.
idx | The column index, starting at 1 |
s | The stream to assign |
len | The number of bytes in the stream |
void odbc::ResultSet::updateAsciiStream | ( | const std::string & | colName, |
std::istream * | s, | ||
int | len | ||
) |
Sets the value of a column to the contens of a stream.
colName | The column name |
s | The stream to assign |
len | The number of bytes in the stream |
void odbc::ResultSet::updateBinaryStream | ( | int | idx, |
std::istream * | s, | ||
int | len | ||
) |
Sets the value of a column to the contens of a stream.
idx | The column index, starting at 1 |
s | The stream to assign |
len | The number of bytes in the stream |
void odbc::ResultSet::updateBinaryStream | ( | const std::string & | colName, |
std::istream * | s, | ||
int | len | ||
) |
Sets the value of a column to the contens of a stream.
colName | The column name |
s | The stream to assign |
len | The number of bytes in the stream |
void odbc::ResultSet::updateBoolean | ( | int | idx, |
bool | val | ||
) |
Sets the value of a column to a bool.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateBoolean | ( | const std::string & | colName, |
bool | val | ||
) |
Sets the value of a column to a bool.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateByte | ( | int | idx, |
signed char | val | ||
) |
Sets the value of a column to a signed char.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateByte | ( | const std::string & | colName, |
signed char | val | ||
) |
Sets the value of a column to a signed char.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateBytes | ( | int | idx, |
const Bytes & | val | ||
) |
Sets the value of a column to a chunk of bytes.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateBytes | ( | const std::string & | colName, |
const Bytes & | val | ||
) |
Sets the value of a column to a chunk of bytes.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateDate | ( | int | idx, |
const Date & | val | ||
) |
Sets the value of a column to a Date.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateDate | ( | const std::string & | colName, |
const Date & | val | ||
) |
Sets the value of a column to a Date.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateDouble | ( | int | idx, |
double | val | ||
) |
Sets the value of a column to a double.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateDouble | ( | const std::string & | colName, |
double | val | ||
) |
Sets the value of a column to a double.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateFloat | ( | int | idx, |
float | val | ||
) |
Sets the value of a column to a float.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateFloat | ( | const std::string & | colName, |
float | val | ||
) |
Sets the value of a column to a float.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateInt | ( | int | idx, |
int | val | ||
) |
Sets the value of a column to an int.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateInt | ( | const std::string & | colName, |
int | val | ||
) |
Sets the value of a column to an int.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateLong | ( | int | idx, |
Long | val | ||
) |
Sets the value of a column to a Long.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateLong | ( | const std::string & | colName, |
Long | val | ||
) |
Sets the value of a column to a Long.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateNull | ( | int | idx | ) |
Sets the value of a column to NULL.
idx | The column index, starting at 1 |
void odbc::ResultSet::updateNull | ( | const std::string & | colName | ) |
Sets the value of a column to NULL.
colName | The column name |
void odbc::ResultSet::updateRow | ( | ) |
Updates the current row.
void odbc::ResultSet::updateShort | ( | int | idx, |
short | val | ||
) |
Sets the value of a column to a short.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateShort | ( | const std::string & | colName, |
short | val | ||
) |
Sets the value of a column to a short.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateString | ( | int | idx, |
const std::string & | val | ||
) |
Sets the value of a column to a string.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateString | ( | const std::string & | colName, |
const std::string & | val | ||
) |
Sets the value of a column to a string.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateTime | ( | int | idx, |
const Time & | val | ||
) |
Sets the value of a column to a Time.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateTime | ( | const std::string & | colName, |
const Time & | val | ||
) |
Sets the value of a column to a Time.
colName | The name of the column |
val | The value to set |
void odbc::ResultSet::updateTimestamp | ( | int | idx, |
const Timestamp & | val | ||
) |
Sets the value of a column to a Timestamp.
idx | The column index, starting at 1 |
val | The value to set |
void odbc::ResultSet::updateTimestamp | ( | const std::string & | colName, |
const Timestamp & | val | ||
) |
Sets the value of a column to a Timestamp.
colName | The name of the column |
val | The value to set |
bool odbc::ResultSet::wasNull | ( | ) |
Checks if the last fetched column value was NULL.
Note that if this is true, the returned value was undefined.