![]() |
![]() |
![]() |
GNOME Data Access manual | ![]() |
---|
A single piece of data can have several representations depending on its usage: a string represantation, an SQL representation and of course a GValue representation. Conversions from one representation to the other is DBMS dependant as each database can have its own SQL representation rules. Thus the GdaDataHandler object was created.
To convert a data, one needs to get a pointer to a GdaDataHandler object (no need to unref() it after usage, data handler objects are stateless). To obtain such a pointer one can:
Ask a GdaDict object for one using the gda_dict_get_default_handler(): the returned data handler is a generic one and should not be used to convert data to use with any connection, but only to have a portable way of storing and loading data in a locale independant fashion.
Ask a GdaDict object for one using the gda_dict_get_handler(): the returned data handler can safely be used to convert data to use with the connection assigned to the dictionary (see this method's documentation for more information)
Ask a GdaServerProvider object for one using the gda_server_provider_get_data_handler_gtype() or gda_server_provider_get_data_handler_dbms(): the returned data handler can then safely be used to convert any data to be used with any connection relying on the GdaServerProvider object.