{"id":41,"date":"2006-12-07T04:39:21","date_gmt":"2006-12-07T02:39:21","guid":{"rendered":"http:\/\/appinf.com\/poco\/blog\/?p=41"},"modified":"2006-12-07T04:39:21","modified_gmt":"2006-12-07T02:39:21","slug":"pocodata-servlets-and-vaporware","status":"publish","type":"post","link":"https:\/\/pocoproject.org\/blog\/?p=41","title":{"rendered":"PocoData, Servlets and Vaporware"},"content":{"rendered":"<p>&#8216;Guilty as charged&#8217; is the verdict. I owe an apology to the audience for selling vapourware. I got stuck with Data, RecordSet, ODBC connector &#038; co, so the servlet engine got pushed on the back burner for the ump-th time. But I&#8217;m getting ready to give it a shot and push it out the door (just don&#8217;t hold me accountable for saying this \ud83d\ude09<\/p>\n<p>Anyway, back to PocoData, what I was trying to achieve is to be able to do something like this:<\/p>\n<p><code> Statement stmt = (session << \"SELECT * FROM aTable\", now);\/\/note no 'into()' provided<\/code><\/p>\n<p>for(RecordSet::Iterator it = stmt.recordSet().begin(); it != stmt.recordSet().end(); ++it)<br \/>\n<span class=\"sym\">{<\/span><br \/>\nint i1 = AnyCast<span class=\"sym\"><<\/span>int<span class=\"sym\">>((*<\/span>it<span class=\"sym\">)[<\/span><span class=\"str\">\"fld1\"<\/span><span class=\"sym\">]));<\/span><br \/>\nfloat f2 = AnyCast<span class=\"sym\"><<\/span>float<span class=\"sym\">>((*<\/span>it<span class=\"sym\">)[<\/span><span class=\"str\">\"fld2\"<\/span><span class=\"sym\">]));<\/span><br \/>\n<span class=\"sym\">}<\/span><br \/>\nNow, all this is  nice and well, but I still must know the type I'm extracting, so not much is achieved. If I could do this:<\/p>\n<p><code> int i = (*it)[\"fld\"].toInt(); <\/code><\/p>\n<p>or this<br \/>\n<code> int i = toInt((*it)[\"fld\"]); <\/code><\/p>\n<p>That would be something, right? Provided I'm not concerned with performance, of course.<br \/>\nOn how to do the above, the jury is still out. And I'm blogging about it hoping to hear some comments and ideas (code is in SVN).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8216;Guilty as charged&#8217; is the verdict. I owe an apology to the audience for selling vapourware. I got stuck with Data, RecordSet, ODBC connector &#038; co, so the servlet engine got pushed on the back burner for the ump-th time. But I&#8217;m getting ready to give it a shot and push it out the door [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=41"}],"version-history":[{"count":0,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions"}],"wp:attachment":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}