corrected to accept hostname and connect to network
[csql.git] / test / sqlnetwork / Connect / conntest1.c
blobe492e2fbb6ce3416ba2addfd056673a209f966e7
1 /* connect ,disconnect and again connect ,it should pass.
3 * AUTHOR : Jitendra Lenka
4 */
6 #include<SqlNwConnection.h>
7 #include<SqlFactory.h>
9 int main()
11 DbRetVal rv =OK;
12 AbsSqlConnection *con = new SqlNwConnection();
13 con->setInnerConnection(NULL);
14 SqlNwConnection *conn = (SqlNwConnection *)con;
15 conn->setHost("localhost", 5678);
16 rv = con->connect("root","manager");
17 if(rv!=OK)return 1;
18 printf("Connection opened\n");
19 rv = con->disconnect();
20 if (rv != OK) { printf("disconnect failed\n"); return 2; }
21 rv = con->connect("root","manager");
22 if(rv !=OK)
24 printf("Test script failed \n");
25 return 3;
27 printf("Connection opened\n");
28 printf("Test script passed\n");
29 delete con;
30 return 0;