skip to main content
Interface Provider class : Overview: Interface Provider class
 

Overview: Interface Provider class

The following table lists all of the functions and associated methods that the OpenAccess SDK SQL engine can call to process queries. In addition to these functions, the IP must implement any functions it has registered for handling user-defined scalar functions and stored procedures. The oajava.sql.ip class shipped with the product defines each of these methods.
Table 1. Functions Supported by an IP
Function
Method Name
Description
CONNECT
Required
ipConnect
Called when a client needs to establish a connection with a data source serviced by the IP. Authentication information such as the user name and password are passed in.
The default value is DAM_SUCCESS. If no return value is specified, the OpenAccess SDK SQL engine assumes that the return value is DAM_SUCCESS.
The IP does not generate a DAM_FAILURE unless specified.
DCL
  Optional
ipDCL
Called with GRANT and other DCL commands to configure privileges.
DDL
  Optional
ipDDL
Called with CREATE TABLE, DROP TABLE, CREATE INDEX, or DROP INDEX code to perform the requested operation (required to support DDL operations).
DISCONNECT
  Required
ipDisconnect
Closes the connection. The IP should close files or other connections established on behalf of this connection.
DYNAMIC_RESULTS
Optional
ipProcedureDynamic
Called to invoke a stored procedure that returns one or more result sets that can be defined at runtime.
END TRANSACTION
Optional
ipEndTransaction
Called with COMMIT or ROLLBACK or PREPARE_TO_COMMIT code.
EXECUTE
  Required
ipExecute
Called to select, insert, update, and delete rows.
GETDSINFO
  Optional
ipGetDSInfo
Called to obtain information about the data source such as the SQL capabilities, limits on object names, and other information that is needed.
GETINFO
  Required
ipGetInfo
Called to get the IP version number and other information.
GETLONGDATA
  Optional
ipGetLongData
Called to stream data from a particular column.
GETSUPPORT
  Required
ipGetSupport
Called to query the IP for the types of operators it supports and the mode of operation.
GETTYPESINFO
  Optional
ipGetTypesInfo
Called to get information about data types.
NATIVE
  Optional
ipNative
Called to execute a command that the OpenAccess SDK SQL engine did not recognize as a valid SQL command.
PRIVILEGE
  Optional
ipPrivilege
Called to verify privileges for the specified user, object, or operation.
PROCEDURE
  Optional
ipProcedure
Called to invoke a stored procedure (only required to support stored procedures with pre-defined result sets).
SCHEMA
  Optional
ipSchema
Called to retrieve the schema information of your database data source (only required to handle schema management).
SCHEMAEX
  Optional
ipSchemaEx
Called to retrieve schema information for stored procedures that define a result set at runtime.
SETINFO
  Required
ipSetInfo
Called to pass connection and statement level settings modified by the client to the IP.
START TRANSACTION
  Optional
ipStartTransaction
Called to initiate a new transaction. The IP uses this entry point to perform transaction management for each connection.
The Java class implementing the IP for the OpenAccess SDK SQL engine must implement the interface oajava.sql.ip. An instance of this class is created for each connection and is used to support requests on that connection.

public interface ip
{
    public String ipGetInfo(int iInfoType);
    public int ipSetInfo(int iInfoType, String InfoVal);
    public int ipGetSupport(int iSupportType);
    public int ipConnect(long tmHandle, long dam_hdbc,
                        String sDataSourceName, String sUserName, String sPassword,
                        String sCurrentCatalog, String sIPProperties,
                         String sIPCustomProperties);
    public int ipDisconnect(long dam_hdbc);
    public int ipStartTransaction(long dam_hdbc);
    public int ipEndTransaction(long dam_hdbc, int iType);
    public int ipExecute(long hstmt, int iStmtType,long hSearchCol,
                        xo_long piNumResRows);
    public int ipSchema(long dam_hdbc, long pMemTree, int iType, long pList,
                        Object pSearchObj);
    public int ipDDL(long hstmt, int iType,xo_long piNumResRows);
    public int ipProcedure(long hstmt, int iType, xo_long piNumResRows);
    public int ipDCL(long hstmt, int iType,xo_long piNumResRows);
    public int ipPrivilege(int iStmtType, String pcUserName,
                        String pcCatalog,String pcSchema,String pcObjName);
    public int ipNative(long hstmt, int iCmdType, String szCmd,
                        xo_long piNumResRows);
    public int ipSchemaEx(long dam_hstmt, long pMemTree, int iType,
                        long pList,Object pSearchObj);
    public int ipProcedureDynamic(long hstmt, int iType, xo_long piNumResRows);
}