how to use connection class in C