soci

Linux 下连接sqlserver(下)

╄→尐↘猪︶ㄣ 提交于 2020-12-16 04:27:08
基于ODBC开发 odbc接口环境部署好后,就可以开始进行开发了,微软官网有详细的接口操作说明,但odbc接口还是太底层,操作起来比较麻烦,这里采用数据库的封装类soci来实现快速开发。 soci是一个用C++封装的数据库访问库,通过“前端(应用程序)/核心/后端(数据库适配)”模式支持firebird,mysql,sqlite3,oracle,postgresql,odbc多种数据库 安装soci git clone https://github.com/SOCI/soci.git cd soci mkdir build cd build cmake .. make sudo make install 注: 一般来说采用默认项就可以了,也可以为cmake附带一些参数: 1、设置自定义的安装目录: -DCMAKE_INSTALL_PREFIX=$HOME/local 2、指定自定义编译程序: -DCMAKE_C_COMPILER=gcc 3、如果你用的较高版本的编译器,默认是开启c++11的,如果cmake得到的SOCI_CXX11为OFF,你可以自行开启 -DSOCI_CXX11=ON, 否则后续使用时将会出现不一致的情况。 执行cmake 你会得到以下信息: 编码 这里有两种方案 1、使用dsn文件进行连接 2、指定连接字符串进行连接 soci是基于odbc进行封装的

银河娱乐集团2020年第二季度及中期业绩

流过昼夜 提交于 2020-08-20 06:53:44
继续与澳门社区紧密合作对抗新冠肺炎 2020 年第二季度集团经调整 EBITDA 录得亏损 14 亿港元,对比去年同期为盈利 43 亿港元, 2020 年第一季度则为盈利 3 亿港元 努力并有效地控制经营成本 香港--(美国商业资讯)--银河娱乐集团(「银娱」、「公司」或「集团」)(香港联合交易所股份代号﹕27)今天公布截至2020年6月30日止三个月及六个月期间之业绩。(除另有注明,所有金额均以港元列示) 本新闻稿包含多媒体。此处查看新闻稿全文: https://www.businesswire.com/news/home/20200813005329/zh-CN/ 银河娱乐集团主席的信 我想藉此机会向各股东报告,银娱在新冠肺炎疫情下的最新情况。对全球的社群及商界而言,包括澳门和银娱,2020年第二季度仍然是困难重重。 首先要说的是,澳门政府在疫情之下继续出色地展示其积极和果断的领导能力,得到社会各界支持,政府的工作重点除了保障公众健康和安全外,亦顾及经济和社会稳定。作为负责任企业,银娱继续与澳门政府、本地中小企和本地劳工紧密合作并予以支持。在新冠肺炎疫情下,内地、香港和澳门都实施旅游限制和保持社交距离,因此对我们2020年第二季度及上半年的业绩构成负面影响。这些限制措施令旅客数量和收入均显著减少,我们在收入低迷及持续应付庞大员工开支的情况下

How to get a whole row from database using SOCI?

核能气质少年 提交于 2019-12-25 06:45:33
问题 ... and save it into self-defined object type? I'm using PostgreSQL. When I have everything in one file, it works. But I wanted to split this into class-files like you always do when writing in cpp. When I divided my code into *.h and *.cpp files, I'm getting errors. Here are my files: test.h class MyInt { public: MyInt(); MyInt(int i); void set(int i); int get() const; private: int i_; }; test.cpp #include "test.h" #include <soci.h> #include <postgresql/soci-postgresql.h> MyInt::MyInt() { }

How to get a whole row from database using SOCI into user-defined object type?

蓝咒 提交于 2019-12-23 10:13:15
问题 I extended my class (from this question: How to get a whole row from database using SOCI?) to have two private members, also added getters and setters. But when compiling my program, I have errors again. myClass.h #include <soci.h> #include <postgresql/soci-postgresql.h> #include <string> class MyClass { public: MyClass(); MyClass(int i, std::string); void setI(int i); int getI() const; void setS(std::string s); std::string getS() const; private: int i_; std::string s_; }; namespace soci {

Soci print out all data in table by rows

我与影子孤独终老i 提交于 2019-12-11 05:15:33
问题 Without knowing the schema, how can I do the above? This is what I have so far: row r; soci::statement st = (mSql->prepare << "select * from tab", soci::into(r)); st.execute(); while (st.fetch()) { //want a way to print each row } 回答1: I did it like this, and it prints out by column: soci::row v; soci::statement st = (mSql->prepare << "SELECT * FROM tab", into(v)); st.execute(true); /* with data exchange */ unsigned int num_fields = v.size(); std::cout << "fields: " << num_fields << std::endl

Undefined symbol error with -static-libasan

帅比萌擦擦* 提交于 2019-12-11 03:28:53
问题 I use address sanitizer to sanitize my application, Which is linked with SOCI. But that prompt followijg error message while using with Oracle. ./SociUT: symbol lookup error: /home/testhome/libs/libsoci_oracle.d.so.1.4.18: undefined symbol: __asan_unregister_globals Here is the build output of aplication /home/rel/GCC/asan-gcc-4.9.3/bc0232/bin/g++ -std=c++11 -g3 -static-libasan -fsanitize=address -fno-omit-frame-pointer -L/home/mt_1/4/4.7.c/build/bc0397/tech/MB/link/API/63 -L/usr/lib64 -L/usr

Calling PLsql script with an anonymous PL SQL block from SOCI

≡放荡痞女 提交于 2019-12-10 15:45:56
问题 I'm searching for a way to call an anonymous PLsql block through SOCI. The data transfer takes place through a refcursor that was previously created as a variable in the script: variable rc refcursor declare v_obj_id number(4,0) := 1; v_obj_def varchar(30); v_obj_type number := 1; begin open :rc for select v_obj_id, OBJ_DEF_ID from MY_OBJECT_DEFS where OBJECT_TYPE = v_obj_type; end; I need to read the refcursor from my application to retrieve the data. I tried to execute the above through a

Using libraries compiled with GCC in a VisualC++ project (and vice versa)

你。 提交于 2019-12-08 09:58:52
问题 It's possible to use code (and libraries) compiled with VisualC++ (so with .lib extension) in a project that will use GCC as compiler (and vice versa)? Or I have to rebuild them? I'm trying to use SOCI 3.1 libraries that I have compiled with VisualC++ in a project that has GCC as compiler, but I'm getting some errors, and I don't know why.. 回答1: You have to produce binaries for GCC using MinGW tools: reimp and dlltool. Here is MinGW wiki with complete explanation of the procedures: MSVC and

C++ SQL database library comparison [closed]

让人想犯罪 __ 提交于 2019-12-03 03:38:16
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am starting development on a medium-scale C++ project that has to work with a Microsoft SQL Server database. I have done database

C++ SQL database library comparison [closed]

北慕城南 提交于 2019-12-02 17:58:50
I am starting development on a medium-scale C++ project that has to work with a Microsoft SQL Server database. I have done database work before using .NET technologies but I don't find using a .NET approach to be appropriate this time. I would like to get some feedback concerning the various free (as in GPL, LGPL, Boost) C/C++ SQL libraries available. I found MySQL++ and SOCI to be pretty interesting and I would like to know which one you guys prefer and why. Also, although this project will primarily be run on Windows workstations, I prefer developing under Linux so cross-platform