MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/db_service/db_service.cpp:97–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97int main(void)
98{
99 acl::acl_cpp_init();
100#ifdef WIN32
101 acl::open_dos();
102#endif
103
104 logger_open("dbservice.log", "dbservice", "all:0");
105
106 if (create_db() == false)
107 {
108 getchar();
109 return (1);
110 }
111
112 acl::aio_handle handle;
113 acl::db_service* server = new acl::db_service_sqlite("DB_TEST", __dbfile, 100, 2);
114
115 // ʹ��Ϣ���������� 127.0.0.1 �ĵ�ַ
116 if (server->open(&handle) == false)
117 {
118 delete server;
119 std::cout << "open server error!" << std::endl;
120 getchar();
121 return (1);
122 }
123
124 acl::string sql;
125 myquery* query;
126
127 for (int i = 0; i < 100; i++)
128 {
129 query = new myquery(i);
130 sql.format("insert into group_tbl('group_name', 'uvip_tbl')"
131 " values('���-%d', 'test')", i);
132 server->sql_update(sql.c_str(), query);
133 }
134
135 while (true)
136 {
137 if (handle.check() == false)
138 {
139 std::cout << "stop now!" << std::endl;
140 break;
141 }
142 }
143
144 delete server;
145 handle.check();
146
147 std::cout << "server stopped!" << std::endl;
148
149 getchar();
150 return (0);
151}
152

Callers

nothing calls this directly

Calls 9

acl_cpp_initFunction · 0.85
open_dosFunction · 0.85
logger_openFunction · 0.85
create_dbFunction · 0.70
openMethod · 0.45
formatMethod · 0.45
sql_updateMethod · 0.45
c_strMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…