가장 모던한 데이터베이스 접근 라이브러리

 

 

 

int id = ...;
string name;
int salary;

sql << "select name, salary from persons where id = " << id,
       into(name), into(salary);

간단한 단일행 쿼리

 

 

int id = ...;
Person p;

sql << "select first_name, last_name, date_of_birth "
       "from persons where id = " << id,
       into(p);

객체 관계 매핑도 가능하다

 

 

Rowset<string> rs = (sql.prepare << "select name from persons");
copy(rs.begin(), rs.end(), ostream_iterator<string>(cout, "\n"));

STL도 지원

 

 

OCCI 4.0.0 버전 기준으로 지원하는 데이터베이스 목록

  • DB2
  • Firebird
  • MySQL
  • ODBC (generic backend)
  • Oracle
  • PostgreSQL

 

 

 

 

soci.sourceforge.net/

 

SOCI

Home Download Documentation Articles People Events Links SOCI is a database access library for C++ that makes the illusion of embedding SQL queries in the regular C++ code, staying entirely within the Standard C++. The idea is to provide C++ programmers a

soci.sourceforge.net

 

'스터디 > C++ 기타' 카테고리의 다른 글

SQLiteCpp 빌드  (0) 2021.02.11
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기