Using an OCI 9.x connection cache requires the same header files and data structures, as described in “Using OCI 8.x connection caches”.
This code sample illustrates the changes you need to make to the “OCI 8.x example” for an OCI 9.x connection. The only differences are the third arguments that you pass to the JagCmGetConnection and JagCmReleaseConnection methods. Other than these changes, the OCI 8.x example works for OCI 9.x connections.
/* Connect to ORACLE */ cache = NULL; ociret = JagCmGetConnection(&cache, USERID, PASSWD, DATASOURCE, "OCI_9", (void*)&svchp, JAG_CM_FORCE); /* Release connection */ ret = JagCmReleaseConnection(&cache, USERID, PASSWD, DATASOURCE, "OCI_9", svchp, JAG_CM_UNUSED);
Copyright © 2005. Sybase Inc. All rights reserved. |