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