adding test scripts
[csql.git] / test / sqlapi / Parameter / common.h
blobf1ab199aba5f3f535b00291bfeda85f2c6942086
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(CSql);
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(CSql);
35 #endif
36 return stmt;