gnomemm r1766 - in libgdamm/trunk: . examples/simple
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1766 - in libgdamm/trunk: . examples/simple
- Date: Tue, 4 Nov 2008 18:50:51 +0000 (UTC)
Author: jhs
Date: Tue Nov 4 18:50:51 2008
New Revision: 1766
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1766&view=rev
Log:
2008-11-04 Johannes Schmid <jschmid openismus com>
* examples/simple/main.cc:
Added some debug code
Modified:
libgdamm/trunk/ChangeLog
libgdamm/trunk/examples/simple/main.cc
Modified: libgdamm/trunk/examples/simple/main.cc
==============================================================================
--- libgdamm/trunk/examples/simple/main.cc (original)
+++ libgdamm/trunk/examples/simple/main.cc Tue Nov 4 18:50:51 2008
@@ -22,6 +22,8 @@
#include <libgdamm.h>
#include <iostream>
+#include <sql-parser/gda-sql-parser.h>
+
using namespace Gnome;
/*
@@ -96,7 +98,22 @@
Glib::RefPtr<Gda::DataModel> data_model;
try
{
- data_model = cnc->statement_execute_select (stmt, params);
+ //data_model = cnc->statement_execute_select (stmt, params);
+ // C equivalent to above call (more or less what libgdamm does internally):
+ // This returns a non-Null model
+ GdaDataModel* model = gda_connection_statement_execute_select(cnc->gobj(), Glib::unwrap(stmt), Glib::unwrap(params), NULL);
+ if (model == NULL)
+ {
+ std::cout << "GdaDataModel == NULL" << std::endl;
+ }
+ g_message ("Type: %s", G_OBJECT_TYPE_NAME (model));
+ // This return 0 instead of a Gda::DataModel object
+ data_model = Glib::wrap(model);
+ if (!data_model)
+ {
+ std::cout << "Gda::DataModel == 0" << std::endl;
+ return;
+ }
}
catch (Glib::Error& err)
{
@@ -104,7 +121,7 @@
<< err.what() << std::endl;
return;
}
- std::cout << data_model->dump_as_string() << std::endl;
+ std::cout << data_model->dump_as_string() << std::endl;
}
int main (int argc, char** argv)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]