|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.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.
QSqlDatabase::lastError()
, and QSqlQuery::lastError()
.
Nested Class Summary | |
---|---|
static class |
QSqlError.ErrorType
This enum type describes the context in which the error occurred, e.g., a connection error, a statement error, etc. |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QSqlError()
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number. |
|
QSqlError(QSqlError other)
Creates a copy of other. |
|
QSqlError(java.lang.String driverText)
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number. |
|
QSqlError(java.lang.String driverText,
java.lang.String databaseText)
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number. |
|
QSqlError(java.lang.String driverText,
java.lang.String databaseText,
QSqlError.ErrorType type)
Constructs an error containing the driver error text driverText, the database-specific error text databaseText, the type type and the optional error number number. |
|
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 | |
---|---|
QSqlError |
clone()
This method is reimplemented for internal reasons |
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. |
boolean |
isValid()
Returns true if an error is set, otherwise false. |
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. |
java.lang.String |
toString()
|
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, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QSqlError(QSqlError other)
public QSqlError(java.lang.String driverText, java.lang.String databaseText, QSqlError.ErrorType type)
public QSqlError(java.lang.String driverText, java.lang.String databaseText)
public QSqlError(java.lang.String driverText)
public QSqlError()
public QSqlError(java.lang.String driverText, java.lang.String databaseText, QSqlError.ErrorType type, int number)
Method Detail |
---|
public final java.lang.String databaseText()
setDatabaseText()
, driverText()
, and text()
.
public final java.lang.String driverText()
setDriverText()
, databaseText()
, and text()
.
public final boolean isValid()
Example:
QSqlQueryModel model = new QSqlQueryModel(); model.setQuery("select * from myTable"); if (model.lastError().isValid()) System.out.println(model.lastError());
type()
.
public final int number()
setNumber()
.
public final void setDatabaseText(java.lang.String databaseText)
databaseText()
, setDriverText()
, and text()
.
public final void setDriverText(java.lang.String driverText)
driverText()
, setDatabaseText()
, and text()
.
public final void setNumber(int number)
number()
.
public final void setType(QSqlError.ErrorType type)
type()
.
public final java.lang.String text()
databaseText()
and driverText()
concatenated into a single string. driverText()
, and databaseText()
.
public final QSqlError.ErrorType type()
setType()
.
public java.lang.String toString()
toString
in class java.lang.Object
public QSqlError clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |