On Fri, 2011-02-18 at 07:42 -0800, Doan Viet Dung wrote: > Hi all, > > > I have two questions, thanks in advance for any suggestion > > > The first one is does soci support to connect to a remote database > (mysql) ? If yes then how can I do ? > > > The second one is: given my below code, when the select query returns > no result, the exception did not throw any thing and the program > continues as normal. How can I catch such exception ? > >
1. set the host and if required the port in the connection string. e.g. host='some.host.de' port=3306 db=database user=bla password='...' http://soci.sourceforge.net/doc/backends/mysql.html 2. session has the got_data method to check if the query returned a result: rootSession << "select rights from myTable where user_id =:id ", into(rights, ind), use(user_id); if (rootSession.got_data()) { ... } http://soci.sourceforge.net/doc/exchange.html Best Regards, Julian Taylor
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________ Soci-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/soci-users
