|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.sql.QSqlError
public class QSqlError
The QSqlError class provides SQL database error information.
A QSqlError object can provide database-specific error data, including the driverText and databaseText messages (or both concatenated together as text), and the error number and type. The functions all have setters so that you can create and return QSqlError objects from your own classes, for example from your own SQL drivers.
Nested Class Summary | |
---|---|
static class |
QSqlError.ErrorType
This enum type describes the type of SQL error that occurred. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QSqlError()
Equivalent to QSqlError(QString(), QString(), NoError, -1). |
|
QSqlError(QSqlError other)
Creates a copy of other. |
|
QSqlError(java.lang.String driverText)
Equivalent to QSqlError(driverText, QString(), NoError, -1). |
|
QSqlError(java.lang.String driverText,
java.lang.String databaseText)
Equivalent to QSqlError(driverText, databaseText, NoError, -1). |
|
QSqlError(java.lang.String driverText,
java.lang.String databaseText,
QSqlError.ErrorType type)
Equivalent to QSqlError(driverText, databaseText, type, -1). |
|
QSqlError(java.lang.String driverText,
java.lang.String databaseText,
QSqlError.ErrorType type,
int number)
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number. |
Method Summary | |
---|---|
java.lang.String |
databaseText()
Returns the text of the error as reported by the database. |
java.lang.String |
driverText()
Returns the text of the error as reported by the driver. |
static QSqlError |
fromNativePointer(QNativePointer nativePointer)
This function returns the QSqlError instance pointed to by nativePointer |
boolean |
isValid()
Returns true if an error is set, otherwise false. |
static QNativePointer |
nativePointerArray(QSqlError[] array)
This function returns a QNativePointer that is pointing to the specified QSqlError array. |
int |
number()
Returns the database-specific error number, or -1 if it cannot be determined. |
void |
setDatabaseText(java.lang.String databaseText)
Sets the database error text to the value of databaseText. |
void |
setDriverText(java.lang.String driverText)
Sets the driver error text to the value of driverText. |
void |
setNumber(int number)
Sets the database-specific error number to number. |
void |
setType(QSqlError.ErrorType type)
Sets the error type to the value of type. |
java.lang.String |
text()
This is a convenience function that returns databaseText and driverText concatenated into a single string. |
QSqlError.ErrorType |
type()
Returns the error type, or -1 if the type cannot be determined. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QSqlError(java.lang.String driverText, java.lang.String databaseText, QSqlError.ErrorType type)
Equivalent to QSqlError(driverText, databaseText, type, -1).
public QSqlError(java.lang.String driverText, java.lang.String databaseText)
Equivalent to QSqlError(driverText, databaseText, NoError, -1).
public QSqlError(java.lang.String driverText)
Equivalent to QSqlError(driverText, QString(), NoError, -1).
public QSqlError()
Equivalent to QSqlError(QString(), QString(), NoError, -1).
public QSqlError(java.lang.String driverText, java.lang.String databaseText, QSqlError.ErrorType type, int number)
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number.
public QSqlError(QSqlError other)
Creates a copy of other.
Method Detail |
---|
public final java.lang.String databaseText()
Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.
public final java.lang.String driverText()
Returns the text of the error as reported by the driver. This may contain database-specific descriptions. It may also be empty.
public final boolean isValid()
Returns true if an error is set, otherwise false.
Example:
QSqlQueryModel model; model.setQuery("select * from myTable"); if (model.lastError().isValid()) qDebug() << model.lastError();
public final int number()
Returns the database-specific error number, or -1 if it cannot be determined.
public final void setDatabaseText(java.lang.String databaseText)
Sets the database error text to the value of databaseText.
public final void setDriverText(java.lang.String driverText)
Sets the driver error text to the value of driverText.
public final void setNumber(int number)
Sets the database-specific error number to number.
public final void setType(QSqlError.ErrorType type)
Sets the error type to the value of type.
public final java.lang.String text()
This is a convenience function that returns databaseText and driverText concatenated into a single string.
public final QSqlError.ErrorType type()
Returns the error type, or -1 if the type cannot be determined.
public static QSqlError fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QSqlError[] array)
array
- the array that the returned pointer will point to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |