Disko Forum logo Login  |  Register  |  Lost Password
How to use datasource

thooge
Posts: 16
graphgraph

How to use datasource 5 Years, 1 Month ago  
Hello again,

i am looking for the right way to use a datasource (SQLite3) in my application.

I cannot find any documentation for that topic...

Greets,
Thomas
 
  The administrator has disabled public write access.
How to use datasource

Stefan
Posts: 91
graph

Re:How to use datasource 5 Years, 1 Month ago  
Hi Thomas,

here is some sample code on how to operate a sqlite database. Hope it helps:

Code:

#include <mms.h> int main(int argc, char *argv[]) { // define the source properties DataSource source(DBMS_SQLITE3,"./mydb"); // create a connection manager for source MMSDBConnMgr conmgr(&source); // retrieve connection IMMSDB *conn = conmgr.getConnection(); // do a query with results MMSRecordSet rs; conn->connect(); conn->query("select * from test;", &rs); if(rs.getCount()>0) do{ std::cout << rs["Name"] << endl; } while(rs.next()); return 0; }
kind regards Stefan
 
  The administrator has disabled public write access.
Powered by FireBoard
get the latest posts directly to your desktop