![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
GdaConnectionEventGdaConnectionEvent — Any event which has occurred on a GdaConnection |
GdaConnectionEvent; enum GdaConnectionEventType; enum GdaConnectionEventCode; GdaConnectionEventType gda_connection_event_get_event_type (GdaConnectionEvent *event
); const gchar * gda_connection_event_get_description (GdaConnectionEvent *event
); glong gda_connection_event_get_code (GdaConnectionEvent *event
); GdaConnectionEventCode gda_connection_event_get_gda_code (GdaConnectionEvent *event
); const gchar * gda_connection_event_get_source (GdaConnectionEvent *event
); const gchar * gda_connection_event_get_sqlstate (GdaConnectionEvent *event
);
Events occurring on a connection are each represented as a GdaConnectionEvent object. Each GdaConnection
is responsible for keeping a list of past events; that list can be consulted using the
gda_connection_get_events()
function.
To avoid memory leaks, the list of connection events is cleared before each statement (or group of statements) is executed.
typedef enum { GDA_CONNECTION_EVENT_NOTICE, GDA_CONNECTION_EVENT_WARNING, GDA_CONNECTION_EVENT_ERROR, GDA_CONNECTION_EVENT_COMMAND } GdaConnectionEventType;
typedef enum { GDA_CONNECTION_EVENT_CODE_CONSTRAINT_VIOLATION, GDA_CONNECTION_EVENT_CODE_RESTRICT_VIOLATION, GDA_CONNECTION_EVENT_CODE_NOT_NULL_VIOLATION, GDA_CONNECTION_EVENT_CODE_FOREIGN_KEY_VIOLATION, GDA_CONNECTION_EVENT_CODE_UNIQUE_VIOLATION, GDA_CONNECTION_EVENT_CODE_CHECK_VIOLATION, GDA_CONNECTION_EVENT_CODE_INSUFFICIENT_PRIVILEGES, GDA_CONNECTION_EVENT_CODE_UNDEFINED_COLUMN, GDA_CONNECTION_EVENT_CODE_UNDEFINED_FUNCTION, GDA_CONNECTION_EVENT_CODE_UNDEFINED_TABLE, GDA_CONNECTION_EVENT_CODE_DUPLICATE_COLUMN, GDA_CONNECTION_EVENT_CODE_DUPLICATE_DATABASE, GDA_CONNECTION_EVENT_CODE_DUPLICATE_FUNCTION, GDA_CONNECTION_EVENT_CODE_DUPLICATE_SCHEMA, GDA_CONNECTION_EVENT_CODE_DUPLICATE_TABLE, GDA_CONNECTION_EVENT_CODE_DUPLICATE_ALIAS, GDA_CONNECTION_EVENT_CODE_DUPLICATE_OBJECT, GDA_CONNECTION_EVENT_CODE_SYNTAX_ERROR, GDA_CONNECTION_EVENT_CODE_UNKNOWN } GdaConnectionEventCode;
GdaConnectionEventType gda_connection_event_get_event_type
(GdaConnectionEvent *event
);
Get event
's severity (from a simple notice to a fatal event)
|
a GdaConnectionEvent object |
Returns : |
the event type |
const gchar * gda_connection_event_get_description
(GdaConnectionEvent *event
);
Get the description of the event. Note that is event
's type is GDA_CONNECTION_EVENT_COMMAND,
the the description is the SQL of the command.
|
a GdaConnectionEvent. |
Returns : |
event 's description.
|
glong gda_connection_event_get_code (GdaConnectionEvent *event
);
|
a GdaConnectionEvent. |
Returns : |
event 's code (the code is specific to the provider being used)
|
GdaConnectionEventCode gda_connection_event_get_gda_code
(GdaConnectionEvent *event
);
Retrieve the code associated to event
.
|
a GdaConnectionEvent |
Returns : |
the GdaConnectionEventCode event's code |
const gchar * gda_connection_event_get_source (GdaConnectionEvent *event
);
|
a GdaConnectionEvent. |
Returns : |
event 's source.
|
const gchar * gda_connection_event_get_sqlstate (GdaConnectionEvent *event
);
Get the SQLSTATE value of event
. Even though the SQLSTATE values are specified by ANSI SQL and ODBC,
consult each DBMS for the possible values. However, the "00000" (success) value means that there is no error,
and the "HY000" (general error) value means an error but no better error code available.
|
a GdaConnectionEvent. |
Returns : |
event 's SQL state.
|
"type"
property"type" gint : Read / Write
Connection event type.
Allowed values: [0,3]
Default value: 2