corrected to accept hostname and connect to network
[csql.git] / test / sqlnetwork / Connect / conntest6.c
blob3d08b14fddb493c200ad80f63062f91b5d01474d
1 /* connect twice without closing the connection,
2 * second conection should return "user already logged in".
4 * Author : Jitendra lenka
5 */
6 #include <SqlNwConnection.h>
7 #include<SqlFactory.h>
8 int main()
10 DbRetVal rv = OK;
11 AbsSqlConnection *con = new SqlNwConnection();
12 con->setInnerConnection(NULL);
13 SqlNwConnection *conn = (SqlNwConnection *) con;
14 conn->setHost("localhost", 5678);
15 rv = con->connect("root","manager");
16 if(rv !=OK)return 1;
17 printf("Connection opened\n");
19 rv = con->connect("root","manager");
20 if(rv==OK)
22 printf("testscript failed\n");
23 return 1;
25 printf("Test script passed\n");
26 delete con;
27 return 0;