Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI help needed

Re: OCI help needed

From: Richard Judd <richard_judd_at_dps.state.ak.us>
Date: Thu, 25 Oct 2001 16:42:46 -0800
Message-ID: <tthcb02usk8u07@corp.supernews.com>


We use OCIServerAttach and pass the service name as defined in Oracle Net8. It handles all the socket interfacing. We then followup with repeated OCIAttrSet calls to set the userid, password and server attribute and then logon through an OCISessionBegin call, a OCIAttrSet call to set up the session attribute and then do the actual OCILogon call. .
"Mike" <mike_at_nospam.com> wrote in message news:b2VA7.8074$Fx6.3621978_at_typhoon.columbus.rr.com...
> I have to connect to oracle database through OCI (I am using C). I have an
> IP and port. The problem for me is how do I let OCI handles know what file
> descriptor to use?
>
> ocifd = openSocket(ipAddress, portNumber) //*--- open port & return file
> descriptor
>
> wher do I specify ocifd in OCI calls?
>
> if (OCIHandleAlloc( (dvoid *) envhp, (dvoid **) &errhp, OCI_HTYPE_ERROR,
> (size_t) 0, (dvoid **) 0)) {
> exit (-1);
> }
>
> if (OCIHandleAlloc( (dvoid *) envhp, (dvoid **) &srvhp,
OCI_HTYPE_SERVER,
> (size_t) 0, (dvoid **) 0)) {
> exit (-1);
> }
>
> if (OCIHandleAlloc( (dvoid *) envhp, (dvoid **) &svchp,
OCI_HTYPE_SVCCTX,
> (size_t) 0, (dvoid **) 0)) {
> exit (-1);
> }
>
> /* set attribute server context in the service context */
> if (OCIAttrSet( (dvoid *) svchp, OCI_HTYPE_SVCCTX, (dvoid *)srvhp,
> (ub4) 0, OCI_ATTR_SERVER, (OCIError *) errhp)) {
> exit(-1);
> }
>
> if (OCIHandleAlloc((dvoid *) envhp, (dvoid **)&authp,
> (ub4) OCI_HTYPE_SESSION, (size_t) 0, (dvoid **) 0)) {
> Trace(ERROR_LEVEL, "OCI_ERROR: OCIHandleAlloc failed.");
> exit (-1);
> }
>
> etc......
>
> Appreciate your help.
> Mike
>
>
Received on Thu Oct 25 2001 - 19:42:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US