*** empty log message ***
[csql.git] / test / adapter / Connect / common.h
blob1c84a1bd42a3c45d58d24d0bf00de0985cfa6ae1
1 #include<SqlFactory.h>
2 #include<SqlNwConnection.h>
3 #include<SqlNwStatement.h>
5 AbsSqlConnection *createConnection()
7 #ifdef NETWORK
8 AbsSqlConnection *con = SqlFactory::createConnection(CSqlNetwork);
9 SqlNwConnection *conn = (SqlNwConnection *) con;
10 conn->setHost("localhost", 5678);
11 #elif defined NETWORKADAPTER
12 AbsSqlConnection *con = SqlFactory::createConnection(CSqlNetworkAdapter);
13 SqlNwConnection *conn = (SqlNwConnection *) con;
14 conn->setHost("localhost", 5678);
15 #elif defined NETWORKGATEWAY
16 AbsSqlConnection *con = SqlFactory::createConnection(CSqlNetworkGateway);
17 SqlNwConnection *conn = (SqlNwConnection *) con;
18 conn->setHost("localhost", 5678);
19 #else
20 AbsSqlConnection *con = SqlFactory::createConnection(CSqlAdapter);
21 #endif
22 return con;
25 AbsSqlStatement *createStatement()
27 #ifdef NETWORK
28 AbsSqlStatement *stmt = SqlFactory::createStatement(CSqlNetwork);
29 #elif defined NETWORKADAPTER
30 AbsSqlStatement *stmt = SqlFactory::createStatement(CSqlNetworkAdapter);
31 #elif defined NETWORKGATEWAY
32 AbsSqlStatement *stmt = SqlFactory::createStatement(CSqlNetworkGateway);
33 #else
34 AbsSqlStatement *stmt = SqlFactory::createStatement(CSqlAdapter);
35 #endif
36 return stmt;