Exemplo n.º 1
0
IIAPI_STATUS
SetConnParam(II_PTR *connHandle,
             II_LONG paramID,
             const II_PTR paramValue)
{
    IIAPI_SETCONPRMPARM	setconnParm;
    IIAPI_WAITPARM	waitParm = { -1 };

    setconnParm.sc_genParm.gp_callback = NULL;
    setconnParm.sc_genParm.gp_closure = NULL;
    setconnParm.sc_connHandle = *connHandle;
    setconnParm.sc_paramID = paramID;
    setconnParm.sc_paramValue = paramValue;
	
    IIapi_setConnectParam(&setconnParm);
	
    while( setconnParm.sc_genParm.gp_completed == FALSE )
        IIapi_wait( &waitParm );
	
    if (setconnParm.sc_genParm.gp_errorHandle)
    {
        OGRIngresStatement::ReportError( &(setconnParm.sc_genParm), 
                                         "Failed to set OpenAPI connection para." );
        return IIAPI_ST_FAILURE;
    }
    else
    {
        /* save the handle   */
        *connHandle = setconnParm.sc_connHandle;
    }
   
    return (setconnParm.sc_genParm.gp_status);
}
Exemplo n.º 2
0
void
gcd_api_setConnParms( GCD_PCB *pcb )
{
    u_i2 idx = --pcb->data.conn.param_cnt;

    pcb->api.name = "IIapi_setConnectParam";
    pcb->api.parm.scon.sc_genParm.gp_callback = gcd_sCon_cmpl;
    pcb->api.parm.scon.sc_genParm.gp_closure = (PTR)pcb;
    pcb->api.parm.scon.sc_connHandle = pcb->ccb->api.conn;
    pcb->api.parm.scon.sc_paramID = pcb->data.conn.parms[idx].id;
    pcb->api.parm.scon.sc_paramValue = pcb->data.conn.parms[idx].value;

    IIapi_setConnectParam( &pcb->api.parm.scon );
    return;
}