oajava.sql
Interface sqlip_stmt


public interface sqlip_stmt

The object used for executing a static SQL statement and obtaining the results produced by it.


Field Summary
static int NOT_NULL_INDICATOR
          Constant to indicate the NOT NUll INDICATOR
static int NULL_INDICATOR
          Constant to indicate the NUll INDICATOR
static int SQL_ALL_TYPES
          Constant to indicate to define all the Data Types
static int SQL_SCOPE_CURROW
          Constant to indicate that the rowid is guaranteed to be valid only while positioned on that row.
static int SQL_SCOPE_SESSION
          Constant to indicate that the rowid is guaranteed to be valid for the duration of the session (across transaction boundaries).
static int SQL_SCOPE_TRANSACTION
          Constant to indicate that the rowid is guaranteed to be valid for the duration of the current transaction.
static int SQLDRV_BUFFER_FULL
          Constant to indicate results in current buffer are completely returned.
static int SQLDRV_EOS
          Constant to indicate that all results are returned.
static int SQLDRV_ERROR
          Constant to indicate Failure from IP routine.
static int SQLDRV_INFO_NEXT_RESULT_SET_AVAILABLE
          Constant to check and see if more result sets are available for the current statement.
static int SQLDRV_INFO_OUTPUT_RESULT_SET_AVAILABLE
          Constant to check whether it had a return code and/or output parameters for the current statement report.
static int SQLDRV_NOT_AVAILABLE
          Constant to indicate that Driver functionality is not available
static int SQLDRV_NTS
          Constant to indicate the NULL Terminated String
static int SQLDRV_SUCCESS
          Constant to indicate Success from IP routine
static int SQLIP_COL_ATTRIB_HIDDEN
          Constant to indicate that the column is a hidden field.
static int SQLIP_COL_ATTRIB_KEY
          Constant to indicate that column is a index field.
static int SQLIP_EOS
          Constant to Indicate IP Routine has nor more error exists.
static int SQLIP_ERROR
          Constant to Indicate IP Routine had an Error
static int SQLIP_FAILURE
          Constant to Indicate IP Routine had an Error
static int SQLIP_SUCCESS
          Constant to Indicate IP Routine was succesful
static int UL_TM_ERRORS
          Constant to indicate message type as "General Errors" in either the protocol or application.
static int UL_TM_F_TRACE
          Constant to indicate message type as function call trace.
static int UL_TM_FATAL
          Constant to indicate message type as "FATAL" error
static int UL_TM_INFO
          Constant to indicate message type as general info to give details about the events.
static int UL_TM_MAJOR_EV
          Constant to indicate message type as major protocol or application events to give the big picture.
static int UL_TM_MINOR_EV
          Constant to indicate message type as minor or secondary protocol or application events to give more detail.
static int UL_TM_PARM
          Constant to indicate message type as "Bad or missing Parameter" passed.
static int UL_TM_SNO
          Constant to indicate message type as "Should not occur" error, usually caused by programmer or spec error
static int UL_TM_TRIVIA
          Constant to indicate message type as trivial info of value only to the implementor.
static int XO_NO_NULLS
          Constant to indicate the Nullable field
static int XO_NTS
          Constant to indicate the data as Null Terminated String
static int XO_NULL_DATA
          Constant to indicate the data as NULL DATA
static int XO_NULLABLE
          Constant to indicate that the column can have NULL values
static int XO_NULLABLE_UNKNOWN
          Constant to indicate that the column's NULL value property is not known.
static int XO_TM_DAY_OF_MONTH
          Constant to indicate the index into the date object array for DAY OF THE MONTH
static int XO_TM_DAY_OF_WEEK
          Constant to indicate the index into the date object array for DAY OF THE WEEK
static int XO_TM_DAY_OF_YEAR
          Constant to indicate the index into the date object array for DAY OF THE YEAR
static int XO_TM_FRACTION
          Constant to indicate the index into the date object array for number of billionths of a second
static int XO_TM_HOUR
          Constant to indicate the index into the date object array for HOUR
static int XO_TM_IS_DST
          Constant to indicate the index into the date object array for DayLight Savings Time
static int XO_TM_MINUTE
          Constant to indicate the index into the date object array for MINUTE
static int XO_TM_MONTH
          Constant to indicate the index into the date object array for MONTH
static int XO_TM_SECOND
          Constant to indicate the index into the date object array for SECOND
static int XO_TM_YEAR
          Constant to indicate the index into the date object array for YEAR
static int XO_TYPE_BIGINT
          Constant to indicate the data type is BIG INT
static int XO_TYPE_BINARY
          Constant to indicate the data type is BINARY
static int XO_TYPE_BIT
          Constant to indicate the data type is BIT
static int XO_TYPE_CHAR
          Constant to indicate the data type is CHAR
static int XO_TYPE_DATE
          Constant to indicate the data type is DATE
static int XO_TYPE_DECIMAL
          Constant to indicate the data type is DECIMAL
static int XO_TYPE_DEFAULT
          Constant to indicate the data type is DEFAULT
static int XO_TYPE_DOUBLE
          Constant to indicate the data type is DOUBLE
static int XO_TYPE_FLOAT
          Constant to indicate the data type is FLOAT
static int XO_TYPE_INTEGER
          Constant to indicate the data type is INTEGER
static int XO_TYPE_LONGVARBINARY
          Constant to indicate the data type is LONG VAR BINARY
static int XO_TYPE_LONGVARCHAR
          Constant to indicate the data type is LONG VARCHAR
static int XO_TYPE_NUMERIC
          Constant to indicate the data type is NUMERIC
static int XO_TYPE_REAL
          Constant to indicate the data type is REAL
static int XO_TYPE_SMALL
          Constant to indicate the data type is SMALL
static int XO_TYPE_SMALLINT
          Constant to indicate the data type is SMALL INT
static int XO_TYPE_TIME
          Constant to indicate the data type is TIME
static int XO_TYPE_TIMESTAMP
          Constant to indicate the data type is TIMESTAMP
static int XO_TYPE_TINYINT
          Constant to indicate the data type is TINY INT
static int XO_TYPE_VARBINARY
          Constant to indicate the data type is VAR BINARY
static int XO_TYPE_VARCHAR
          Constant to indicate the data type is VARCHAR
static int XO_TYPE_VARIANT
          Constant to indicate the data type is VARIANT
 
Method Summary
 int sqlipBestRowIdentifier(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)
          Called by the OpenAccess layer to get a table's optimal set of columns that uniquely identifies a row.
 int sqlipCatalogs()
          Close the cursor and clear the result table.
 int sqlipCloseCursor()
          Close the cursor and clear the result table.
 int sqlipCloseStmt()
          Close the current statement and free all resources used to execute commands on it.
 int sqlipColumns(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column)
          Called by the OpenAccess layer to get column list.
 int sqlipDeclareCursor(java.lang.String psCursorName)
          Associate the cursor name with the prepared statement.
 int sqlipError(java.lang.StringBuffer sSqlState, xo_int piNativeError, java.lang.StringBuffer sErrorText)
          Return the error during the last operation on this object.
 int sqlipFetchRow()
          Fetch data at the current cursor position and advance the cursor to the next row of the result table.
 int sqlipForeignKeys(java.lang.String primaryCatalog, java.lang.String primarySchema, java.lang.String primaryTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)
          Called by the OpenAccess layer to get foreign key list.
 int sqlipGetColspec(int iColNum, xo_int piXODataType, xo_int pbNullable, java.lang.StringBuffer pColName, xo_int piLen, xo_int piPrecision, xo_int piScale, xo_col_attribute pColAttributes, xo_int iFlags)
          Returns the description for the specified column.
 java.lang.Object sqlipGetColval(int iColNum, xo_int piXODataType, xo_int piIndicator, xo_int piStatus)
          Returns the value of the specified column for the current row.
 int sqlipGetInfo(int iInfoType, java.lang.StringBuffer sInfoValue)
          Called by the OpenAccess layer to request information from the IP.
 int sqlipGetNumcols(xo_int piNumCols)
          Return the number of columns in the result set.
 int sqlipGetNumparams(xo_int piNumParams)
          Returns the number of parameter markers in the prepared stmt.
 int sqlipGetParamSpec(int iParmNum, xo_int iXoDataType, xo_int piNullable, xo_int piLen, xo_int piPrecision, xo_int piScale, xo_int piDirection, xo_int piFlags)
          Returns the description for the specified parameter.
 int sqlipIndexInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)
          Close the cursor and clear the result table.
 int sqlipInitParam(int iParam, int iIndicator, java.lang.String sValAsStr, int iXODataType)
          This function will be called for each input parameter that has been specified by the client application.
 int sqlipIsCursorOpen(xo_int piCursorOpen)
          Check if the cursor is open.
 int sqlipMapToXoType(int iJavaType)
          Called by the OpenAccess layer to map database specific data type to OpenAccess data type during the fetching of rows from a schema request.
 int sqlipOpenCursor(xo_int piNumResRows)
          This function is called to execute both SELECT and non-select prepared statements.
 int sqlipOpenNextCursor(xo_int piNumResRows)
          If the statement has more results pending then move to the next result.
 int sqlipOpenOutputCursor(xo_int piNumResRows)
          If the statement is a stored procedure call and it has output parameters and/or output return value then this function should return a cursor for accessing this information.
 int sqlipPrepareStmt(java.lang.String sSqlStmt)
          Parse the given SQL stmt (check any syntax errors) and generate plan for executing the statement.
 int sqlipPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)
          Called by the OpenAccess layer to get primary key list.
 int sqlipProcedureColumns(java.lang.String catalog, java.lang.String schema, java.lang.String procedure, java.lang.String column)
          Called by the OpenAccess layer to get store procedure column list.
 int sqlipProcedures(java.lang.String catalog, java.lang.String schema, java.lang.String procedure)
          Called by the OpenAccess layer to get store procedure list.
 int sqlipSchemas()
          Called by the OpenAccess layer to get catalog list.
 int sqlipSetInfo(java.lang.String pCmdArgs)
          Called by the OpenAccess layer to inform the IP of various connection and statement level options like the maximum number of rows to return, transaction commit mode, query timeout, etc.
 int sqlipTables(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String types)
          Called by the OpenAccess layer to get table list.
 int sqlipTableTypes()
          Called by the OpenAccess layer to get table type list.
 int sqlipTypeInfo(int type)
          Called by the OpenAccess layer to get data type list.
 int sqlipVersionColumns(java.lang.String catalog, java.lang.String schema, java.lang.String table)
          Called by the OpenAccess layer to get a table's columns that are automatically updated when any value in a row is updated.
 

Field Detail

SQLDRV_SUCCESS

public static final int SQLDRV_SUCCESS
Constant to indicate Success from IP routine

SQLDRV_EOS

public static final int SQLDRV_EOS
Constant to indicate that all results are returned. End of Data.

SQLDRV_BUFFER_FULL

public static final int SQLDRV_BUFFER_FULL
Constant to indicate results in current buffer are completely returned.

SQLDRV_ERROR

public static final int SQLDRV_ERROR
Constant to indicate Failure from IP routine.

SQLDRV_NOT_AVAILABLE

public static final int SQLDRV_NOT_AVAILABLE
Constant to indicate that Driver functionality is not available

SQLIP_SUCCESS

public static final int SQLIP_SUCCESS
Constant to Indicate IP Routine was succesful

SQLIP_FAILURE

public static final int SQLIP_FAILURE
Constant to Indicate IP Routine had an Error

SQLIP_ERROR

public static final int SQLIP_ERROR
Constant to Indicate IP Routine had an Error

SQLIP_EOS

public static final int SQLIP_EOS
Constant to Indicate IP Routine has nor more error exists.

UL_TM_FATAL

public static final int UL_TM_FATAL
Constant to indicate message type as "FATAL" error

UL_TM_SNO

public static final int UL_TM_SNO
Constant to indicate message type as "Should not occur" error, usually caused by programmer or spec error

UL_TM_PARM

public static final int UL_TM_PARM
Constant to indicate message type as "Bad or missing Parameter" passed.

UL_TM_ERRORS

public static final int UL_TM_ERRORS
Constant to indicate message type as "General Errors" in either the protocol or application.

UL_TM_MAJOR_EV

public static final int UL_TM_MAJOR_EV
Constant to indicate message type as major protocol or application events to give the big picture.

UL_TM_MINOR_EV

public static final int UL_TM_MINOR_EV
Constant to indicate message type as minor or secondary protocol or application events to give more detail.

UL_TM_INFO

public static final int UL_TM_INFO
Constant to indicate message type as general info to give details about the events.

UL_TM_F_TRACE

public static final int UL_TM_F_TRACE
Constant to indicate message type as function call trace.

UL_TM_TRIVIA

public static final int UL_TM_TRIVIA
Constant to indicate message type as trivial info of value only to the implementor.

XO_TYPE_CHAR

public static final int XO_TYPE_CHAR
Constant to indicate the data type is CHAR

XO_TYPE_NUMERIC

public static final int XO_TYPE_NUMERIC
Constant to indicate the data type is NUMERIC

XO_TYPE_DECIMAL

public static final int XO_TYPE_DECIMAL
Constant to indicate the data type is DECIMAL

XO_TYPE_INTEGER

public static final int XO_TYPE_INTEGER
Constant to indicate the data type is INTEGER

XO_TYPE_SMALL

public static final int XO_TYPE_SMALL
Constant to indicate the data type is SMALL

XO_TYPE_SMALLINT

public static final int XO_TYPE_SMALLINT
Constant to indicate the data type is SMALL INT

XO_TYPE_FLOAT

public static final int XO_TYPE_FLOAT
Constant to indicate the data type is FLOAT

XO_TYPE_REAL

public static final int XO_TYPE_REAL
Constant to indicate the data type is REAL

XO_TYPE_DOUBLE

public static final int XO_TYPE_DOUBLE
Constant to indicate the data type is DOUBLE

XO_TYPE_DATE

public static final int XO_TYPE_DATE
Constant to indicate the data type is DATE

XO_TYPE_TIME

public static final int XO_TYPE_TIME
Constant to indicate the data type is TIME

XO_TYPE_TIMESTAMP

public static final int XO_TYPE_TIMESTAMP
Constant to indicate the data type is TIMESTAMP

XO_TYPE_VARCHAR

public static final int XO_TYPE_VARCHAR
Constant to indicate the data type is VARCHAR

XO_TYPE_VARIANT

public static final int XO_TYPE_VARIANT
Constant to indicate the data type is VARIANT

XO_TYPE_LONGVARCHAR

public static final int XO_TYPE_LONGVARCHAR
Constant to indicate the data type is LONG VARCHAR

XO_TYPE_VARBINARY

public static final int XO_TYPE_VARBINARY
Constant to indicate the data type is VAR BINARY

XO_TYPE_BINARY

public static final int XO_TYPE_BINARY
Constant to indicate the data type is BINARY

XO_TYPE_LONGVARBINARY

public static final int XO_TYPE_LONGVARBINARY
Constant to indicate the data type is LONG VAR BINARY

XO_TYPE_BIGINT

public static final int XO_TYPE_BIGINT
Constant to indicate the data type is BIG INT

XO_TYPE_TINYINT

public static final int XO_TYPE_TINYINT
Constant to indicate the data type is TINY INT

XO_TYPE_BIT

public static final int XO_TYPE_BIT
Constant to indicate the data type is BIT

XO_TYPE_DEFAULT

public static final int XO_TYPE_DEFAULT
Constant to indicate the data type is DEFAULT

XO_NULL_DATA

public static final int XO_NULL_DATA
Constant to indicate the data as NULL DATA

XO_NTS

public static final int XO_NTS
Constant to indicate the data as Null Terminated String

NULL_INDICATOR

public static final int NULL_INDICATOR
Constant to indicate the NUll INDICATOR

NOT_NULL_INDICATOR

public static final int NOT_NULL_INDICATOR
Constant to indicate the NOT NUll INDICATOR

SQLDRV_NTS

public static final int SQLDRV_NTS
Constant to indicate the NULL Terminated String

XO_NO_NULLS

public static final int XO_NO_NULLS
Constant to indicate the Nullable field

XO_NULLABLE

public static final int XO_NULLABLE
Constant to indicate that the column can have NULL values

XO_NULLABLE_UNKNOWN

public static final int XO_NULLABLE_UNKNOWN
Constant to indicate that the column's NULL value property is not known.

SQLDRV_INFO_NEXT_RESULT_SET_AVAILABLE

public static final int SQLDRV_INFO_NEXT_RESULT_SET_AVAILABLE
Constant to check and see if more result sets are available for the current statement.

SQLDRV_INFO_OUTPUT_RESULT_SET_AVAILABLE

public static final int SQLDRV_INFO_OUTPUT_RESULT_SET_AVAILABLE
Constant to check whether it had a return code and/or output parameters for the current statement report.

SQLIP_COL_ATTRIB_HIDDEN

public static final int SQLIP_COL_ATTRIB_HIDDEN
Constant to indicate that the column is a hidden field.

SQLIP_COL_ATTRIB_KEY

public static final int SQLIP_COL_ATTRIB_KEY
Constant to indicate that column is a index field.

XO_TM_SECOND

public static final int XO_TM_SECOND
Constant to indicate the index into the date object array for SECOND

XO_TM_MINUTE

public static final int XO_TM_MINUTE
Constant to indicate the index into the date object array for MINUTE

XO_TM_HOUR

public static final int XO_TM_HOUR
Constant to indicate the index into the date object array for HOUR

XO_TM_DAY_OF_MONTH

public static final int XO_TM_DAY_OF_MONTH
Constant to indicate the index into the date object array for DAY OF THE MONTH

XO_TM_MONTH

public static final int XO_TM_MONTH
Constant to indicate the index into the date object array for MONTH

XO_TM_YEAR

public static final int XO_TM_YEAR
Constant to indicate the index into the date object array for YEAR

XO_TM_DAY_OF_WEEK

public static final int XO_TM_DAY_OF_WEEK
Constant to indicate the index into the date object array for DAY OF THE WEEK

XO_TM_DAY_OF_YEAR

public static final int XO_TM_DAY_OF_YEAR
Constant to indicate the index into the date object array for DAY OF THE YEAR

XO_TM_IS_DST

public static final int XO_TM_IS_DST
Constant to indicate the index into the date object array for DayLight Savings Time

XO_TM_FRACTION

public static final int XO_TM_FRACTION
Constant to indicate the index into the date object array for number of billionths of a second

SQL_ALL_TYPES

public static final int SQL_ALL_TYPES
Constant to indicate to define all the Data Types

SQL_SCOPE_CURROW

public static final int SQL_SCOPE_CURROW
Constant to indicate that the rowid is guaranteed to be valid only while positioned on that row.

SQL_SCOPE_TRANSACTION

public static final int SQL_SCOPE_TRANSACTION
Constant to indicate that the rowid is guaranteed to be valid for the duration of the current transaction.

SQL_SCOPE_SESSION

public static final int SQL_SCOPE_SESSION
Constant to indicate that the rowid is guaranteed to be valid for the duration of the session (across transaction boundaries).
Method Detail

sqlipCloseCursor

public int sqlipCloseCursor()
Close the cursor and clear the result table. Free the Exec memory tree if the IP had a seperate memory tree for statement execution. This function is called in response to the client performing free on a statement handle or when the end of the result set is reached.

Returns:
  • SQLDRV_SUCCESS - success closing the cursor
  • SQLDRV_ERROR - error in closing the cursor

sqlipCloseStmt

public int sqlipCloseStmt()
Close the current statement and free all resources used to execute commands on it. This is the last method that will be called on this instance of the statement object.

Returns:
  • SQLDRV_SUCCESS - success closing the statement
  • SQLDRV_ERROR - error closing the statement

sqlipDeclareCursor

public int sqlipDeclareCursor(java.lang.String psCursorName)
Associate the cursor name with the prepared statement. If the IP doesn't need to use a pre-defined cursor name then it can have this function do nothing but return SQLDRV_SUCCESS. A unique cursor name is generated for each connection/statement pair.

Parameters:
cursorName - Cursor name
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipError

public int sqlipError(java.lang.StringBuffer sSqlState,
                      xo_int piNativeError,
                      java.lang.StringBuffer sErrorText)
Return the error during the last operation on this object. Once the error is returned, delete the error from the list of errors on the specified statement or connection. This function will be will called until it returns SQLDRV_EOS to indicate no more errors are present.

Parameters:
sSqlState - Return a 5 character SQL sate string if the sSqlState is not NULL.
piNativeError - Return an integer value indicating a native error. This code will be made available to the client application. Provide this if piNativeError in not NULL.
sErrorText - Return error message of length SQLDRV_MAX_MESSAGE_LENGTH or less if sErrorText is not NULL.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_EOS - no errors available
  • SQLDRV_ERROR

sqlipFetchRow

public int sqlipFetchRow()
Fetch data at the current cursor position and advance the cursor to the next row of the result table. If no more results are available then return SQLDRV_EOS. If you want to return the results in blocks then either use the FETCH_BLOCK_SIZE setting from the client or some other measure to control the blocking. Return SQLDRV_BUFFER_FULL to indicate that all rows from current block have been returned. Normal sequence is the IP gets called with fetch_row and then with get_colval for each column to retrieve the data.

Returns:
  • SQLDRV_SUCCESS valid row fetched
  • SQLDRV_BUFFER_FULL - indicates that this is the last row in the current block of the rows to return to the client.
  • SQLDRV_EOS - no more data available
  • SQLDRV_ERROR - error fetching a row

sqlipGetColspec

public int sqlipGetColspec(int iColNum,
                           xo_int piXODataType,
                           xo_int pbNullable,
                           java.lang.StringBuffer pColName,
                           xo_int piLen,
                           xo_int piPrecision,
                           xo_int piScale,
                           xo_col_attribute pColAttributes,
                           xo_int iFlags)
Returns the description for the specified column. This function will be called M times where M is the number of columns returned by the get_numcols functions. You must return the data in the get_colval function in the same format as the definition of the column. For example, if you return the description of the first column as XO_TYPE_INTEGER then in get_colval you will return the data as XO_TYPE_INTEGER. It's also important to make sure the column descriptions returned by the get_colspec function match those defined in your schema.

Parameters:
iColNum - Column number - first column starts at zero.
piXODataType - Data type of the column. This information describes how the value of this column will be returned when get_colval is called.
pbNullable - Whether the column can have null values or not
  • 1 - column can have null values
  • 0 - the column cannot have null values
pColName - Allocate a buffer, fill it with the column name and return the pointer to this buffer. This buffer is used by the calling function.
piLen - Maximum length of the data in this column. Leave null for other types.
  • CHAR and VARCHAR - maximum length of the string
  • NUMERIC - precision + 2
piPrecision - Number of digits of mantissa precision.
  • NUMERIC - Number of digits
  • CHAR and VARCHAR - set to same as piLen
  • INTEGER=10, SMALLINT=5, DOUBLE=15, REAL=7,FLOAT=15
  • DATE=10, TIME=8, TIMESTAMP=19
piScale - Total # of significant digits to the right of the decimal point. Only required for NUMERIC types
pColAttributes - Object into which additional column attributes can be returned. Leave as is if you don't want to return any additional information for each column. Only the OLE DB client currently uses this information. A column is uniquely identified by [sCatalogName].[sSchemaName].[sBaseTableName].[sBaseColumnName].
iFlags - Column flag formed by logical OR of one or more of the following:
  • SQLIP_COL_ATTRIB_HIDDEN - the column is hidden
  • SQLIP_COL_ATTRIB_KEY - the column is a primary key
Only the OLE DB client currently uses this information.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipGetColval

public java.lang.Object sqlipGetColval(int iColNum,
                                       xo_int piXODataType,
                                       xo_int piIndicator,
                                       xo_int piStatus)
Returns the value of the specified column for the current row.

Parameters:
iColNum - Column number - first column starts at zero.
piXODataType - Data type of the column. This information describes how the value is stored at the pointer returned in ppVal.
piIndicator - Whether the column value is null or not.
  • NULL_INIDICATOR - the value is null and therefore ppVal will not contain a valid pointer.
  • NULL_INDICATOR - the column has a value and will be returned in an object.
piStatus -
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR
Returns:
Create a object to hold the column value and return it. The OpenAccess layer releases the object. The table below refers for what object type to use for the various data types
  • XO_TYPE_CHAR
  • XO_TYPE_NUMERIC
  • XO_TYPE_INTEGER
  • XO_TYPE_SMALLINT
  • XO_TYPE_FLOAT
  • XO_TYPE_REAL
  • XO_TYPE_DOUBLE
  • XO_TYPE_DATE
  • XO_TYPE_TIME
  • XO_TYPE_TIMESTAMP
  • XO_TYPE_VARCHAR
  • XO_TYPE_LONGVARBINARY

sqlipGetInfo

public int sqlipGetInfo(int iInfoType,
                        java.lang.StringBuffer sInfoValue)
Called by the OpenAccess layer to request information from the IP.

Parameters:
iInfoType -
  • SQLDRV_INFO_NEXT_RESULT_SET_AVAILABLE (1) - For the current statement check and see if more result sets are available. Return a value of 1 if more result sets are available, otherwise return 0. Returning a 1 will result in the open_next_cursor method being called.
  • SQLDRV_INFO_OUTPUT_RESULT_SET_AVAILABLE (2) - For the current statement report whether it had a return code and/or output parameters. Return a value of 1 if yes, otherwise return 0. Returning a 1 will result in the open_output_cursor being called.
sInfoValue - Buffer to return the data into.
Returns:
  • SQLDRV_SUCCESS - if the requested option is supported.
  • SQLDRV_ERROR - error occurred in obtaining the requested information.

sqlipGetNumcols

public int sqlipGetNumcols(xo_int piNumCols)
Return the number of columns in the result set. If the statement is a DML (INSERT, UPDATE, DELETE), it should return 0 to indicate that a cursor does not exist. If the statement has been prepared or a sqlipOpenCursor has been called and your engine has determined what the result set looks like then it should return a non-zero value and be ready to provide column descriptors when sqlipGetColspec is called.

For prepared statements, this function is called immediately after a call to sqlipPrepareStmt. If at this time your backend is not capable of determining the result specification then it should return 0 for the number of columns. This function is also called immediately after a call to sqlipOpenCursor and sqlipOpenNextCursor. At this time it must return a non-zero value for the number of columns if any rows are to be fetched.

Parameters:
piNumCols - Number of columns if at this point you can determine the result set. Return 0 otherwise.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipGetNumparams

public int sqlipGetNumparams(xo_int piNumParams)
Returns the number of parameter markers in the prepared stmt. If the statement does not have any parameters, returns 0. OpenAccess does not require the parameter indicator to be a question mark but ODBC assumes the '?' to be the parameter indicator.

Parameters:
piNumParams - Number of parameters. A valid value is required otherwise the OpenAccess layer will report a mismatch in the number of parameter values passed in and the number of parameters in the query reported by this method.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipInitParam

public int sqlipInitParam(int iParam,
                          int iIndicator,
                          java.lang.String sValAsStr,
                          int iXODataType)
This function will be called for each input parameter that has been specified by the client application. It should initialize the parameter with the specified value. All parameters values are passed in as character string buffers.

Parameters:
iParam - Parame ter number - first parameter starts at zero.
iIndicator - Indicates whether the value is null terminated or is a valid NULL terinated string:
  • NULL_INDICATOR - the parameter's value is NULL
  • SQL_NTS - sValAsStr contains the data in string format.
sValAsStr - Parameter value as a string.
iXODataType - Data type of the parameter as specified by the client application. Use this information to determine how to interpret the value passed in as a string so that it can be passed to the backend database accordingly. In many cases you can just pass it in as a string as the backend will handle all conversions.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipIsCursorOpen

public int sqlipIsCursorOpen(xo_int piCursorOpen)
Check if the cursor is open. A cursor is opened when sqlipOpenCursor is called.

Parameters:
piCursorOpen - 1 means cursor is open and 0 means closed.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipOpenCursor

public int sqlipOpenCursor(xo_int piNumResRows)
This function is called to execute both SELECT and non-select prepared statements.

For statements that result in a cursor the IP should execute the statement and open the cursor to the first row. Return the number of rows selected in the piNumResRows parameter. If the number of rows selected cannot be determined at this time then return -1. A close_cursor will be called when all rows have been fetched or when the application closes the statement.

For statements that update the data (INSERT, UPDATE, DELETE, etc), the IP should execute the statement and return in the piNumResRows the number of rows affected and return 0 for the number of columns in the cursor when sqlipGetNumcols is called. A sqlipCloseCursor is not called when no columns are returned.

Parameters:
piNumResRows - Number of rows in the cursor or the number of rows affected for data modifying query. If the statement results in a cursor and the number of rows in the cursor cannot be determined then return -1.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipOpenNextCursor

public int sqlipOpenNextCursor(xo_int piNumResRows)
If the statement has more results pending then move to the next result. This function is called if the sqlipGetInfo reports that the statement has more results. A call to sqlipGetcolspec after calling this function should return the description of this new cursor.

Parameters:
piNumResRows - Number of rows in the cursor or the number of rows affected for data modifying query. If the statement results in a cursor and the number of rows in the cursor cannot be determined then return -1.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR - error closing the statement

sqlipOpenOutputCursor

public int sqlipOpenOutputCursor(xo_int piNumResRows)
If the statement is a stored procedure call and it has output parameters and/or output return value then this function should return a cursor for accessing this information. The cursor will contain a single row with one column for the return value and one column for each output parameter. Call to sqlipGetColspec after calling this function should return the description of the output cursor.

Parameters:
piNumResRows - Number or rows in this cursor. Should be one or zero.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipPrepareStmt

public int sqlipPrepareStmt(java.lang.String sSqlStmt)
Parse the given SQL stmt (check any syntax errors) and generate plan for executing the statement. The IP should collect information about any parameters in the statement and also description about result columns (if stmt is of type SELECT). Normal sequence would be a call to alloc_stmt, followed by prepare_stmt followed by get_colspec, followed by declare_cursor, followed by open_cursor, followed by fetch_row, etc

Parameters:
sSqlStmt - SQL string to prepare.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipSetInfo

public int sqlipSetInfo(java.lang.String pCmdArgs)
Called by the OpenAccess layer to inform the IP of various connection and statement level options like the maximum number of rows to return, transaction commit mode, query timeout, etc. The IP can optionally use this information in its processing.

Parameters:
pCmdArgs - The options string contains settings for maximum number of rows, query timeout, and extended column attributes. These settings are passed in using keywords mrows, qt, and op. An example options string is: 'mrows=0;qt=0;op=0'
  • mrows - the number of rows to limit the results to. A value of zero indicates no limit and is the default.
  • qt - query timeout in seconds. A value of 0 indicates to limit and is the default.
  • op - additional bit type of options.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipGetParamSpec

public int sqlipGetParamSpec(int iParmNum,
                             xo_int iXoDataType,
                             xo_int piNullable,
                             xo_int piLen,
                             xo_int piPrecision,
                             xo_int piScale,
                             xo_int piDirection,
                             xo_int piFlags)
Returns the description for the specified parameter. This function will be called M times where M is the number of parameters returned by the get_numparams functions. This function is called if the oa_info entry SQL_SP_STMT_OPTIONS_SUPPORT (id = 8196) has bit 1 set (bits are numbered with 0th being the least significant bit).

Parameters:
iParmNum - Parameter number - first parameter starts at one.
iXoDataType - Data type of the parameter.
piNullable - Whether the column can have null values or not.
  • 1 - column can have null values
  • 0 - the column cannot have null values
piLen - Maximum length of the data in this column. Leave null for other types. This value cannot be larger then 0x7fffffff
  • CHAR and VARCHAR - maximum length of the string
  • NUMERIC - precision + 2
piPrecision - Number of digits of mantissa precision.
  • NUMERIC - Number of digits
  • CHAR and VARCHAR - set to same as piLen
  • INTEGER=10, SMALLINT=5, DOUBLE=15, REAL=7,FLOAT=15
  • DATE=10, TIME=8, TIMESTAMP=19
piScale - Total # of significant digits to the right of the decimal point. Only required for NUMERIC types
piDirection - Direction of the parameter.
  • SQL_PARAM_TYPE_UNKNOWN (0)
  • SQL_PARAM_INPUT (1)
  • SQL_PARAM_INPUT_OUTPUT (2)
  • SQL_PARAM_OUTPUT (4)
  • SQL_PARAM_RETURN_VALUE (5)
piFlags - Not used
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipMapToXoType

public int sqlipMapToXoType(int iJavaType)
Called by the OpenAccess layer to map database specific data type to OpenAccess data type during the fetching of rows from a schema request. This function is called with the DATA_TYPE field returned from either a call to a schema method (i.e. sqlipColumns) or by direct executing of a query on an OpenAccess schema table (i.e. OA_COLUMNS). If the mapping of the underlying database types to the OpenAccess data types is not handled in the cursor that is returned then this function should perform the mapping. The output should be a corresponding OpenAccess data type as defined by the XO data type table Table 4?3. Schema methods sqlipColumns, sqlipProcedureColumns, sqlipTypeInfo and sqlipBestRowIdentifier return a column DATA_TYPE containing a data type code. If the data type mapping is handled at the schema level then this function should simply set the return value to the input value.

The methods sqlipGetColspec, sqlipGetParamSpec, and sqlipGetColval must always return the data type (passed back in iXODataType object) using the OpenAccess data type codes.

Parameters:
iJavaType - Database specific data type code
Returns:
XO data type

sqlipTables

public int sqlipTables(java.lang.String catalog,
                       java.lang.String schema,
                       java.lang.String table,
                       java.lang.String types)
Called by the OpenAccess layer to get table list.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
types - Table types name uses to narrow down the search. Table types are separated by comma. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipColumns

public int sqlipColumns(java.lang.String catalog,
                        java.lang.String schema,
                        java.lang.String table,
                        java.lang.String column)
Called by the OpenAccess layer to get column list.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
column - Column name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipPrimaryKeys

public int sqlipPrimaryKeys(java.lang.String catalog,
                            java.lang.String schema,
                            java.lang.String table)
Called by the OpenAccess layer to get primary key list.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipCatalogs

public int sqlipCatalogs()
Close the cursor and clear the result table.

Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipSchemas

public int sqlipSchemas()
Called by the OpenAccess layer to get catalog list.

Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipTableTypes

public int sqlipTableTypes()
Called by the OpenAccess layer to get table type list.

Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipIndexInfo

public int sqlipIndexInfo(java.lang.String catalog,
                          java.lang.String schema,
                          java.lang.String table,
                          boolean unique,
                          boolean approximate)
Close the cursor and clear the result table.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
unique -
  • true means that only indices for unique values will be returned;
  • false means that all indices will be returned.
approximate -
  • true means that results are allowed to reflect approximate or out-of-date values;
  • false requests that results be accurate.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipProcedures

public int sqlipProcedures(java.lang.String catalog,
                           java.lang.String schema,
                           java.lang.String procedure)
Called by the OpenAccess layer to get store procedure list.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
procedure - Procedure name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipProcedureColumns

public int sqlipProcedureColumns(java.lang.String catalog,
                                 java.lang.String schema,
                                 java.lang.String procedure,
                                 java.lang.String column)
Called by the OpenAccess layer to get store procedure column list.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
procedure - Procedure name uses to narrow down the search. null indicates ignore it for search.
column - Procedure column name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipBestRowIdentifier

public int sqlipBestRowIdentifier(java.lang.String catalog,
                                  java.lang.String schema,
                                  java.lang.String table,
                                  int scope,
                                  boolean nullable)
Called by the OpenAccess layer to get a table's optimal set of columns that uniquely identifies a row.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
scope - Indicates scope of interest. Value will be one of
  • SQL_SCOPE_CURROW
  • SQL_SCOPE_TRANSACTION
  • SQL_SCOPE_SESSION.
nullable -
  • true to indicate that columns that are nullable may be included
  • false to exclude columns that can be null.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipVersionColumns

public int sqlipVersionColumns(java.lang.String catalog,
                               java.lang.String schema,
                               java.lang.String table)
Called by the OpenAccess layer to get a table's columns that are automatically updated when any value in a row is updated.

Parameters:
catalog - Catalog name uses to narrow down the search. null indicates ignore it for search.
schema - Schema name uses to narrow down the search. null indicates ignore it for search.
table - Table name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipForeignKeys

public int sqlipForeignKeys(java.lang.String primaryCatalog,
                            java.lang.String primarySchema,
                            java.lang.String primaryTable,
                            java.lang.String foreignCatalog,
                            java.lang.String foreignSchema,
                            java.lang.String foreignTable)
Called by the OpenAccess layer to get foreign key list.

Parameters:
primaryCatalog - Primary key catalog name uses to narrow down the search. null indicates ignore it for search.
primarySchema - Primary key schema name uses to narrow down the search. null indicates ignore it for search.
primaryTable - Primary key table name uses to narrow down the search. null indicates ignore it for search.
foreignCatalog - Foreign key catalog name uses to narrow down the search. null indicates ignore it for search.
foreignSchema - Foreign key schema name uses to narrow down the search. null indicates ignore it for search.
foreignTable - Foreign key table name uses to narrow down the search. null indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR

sqlipTypeInfo

public int sqlipTypeInfo(int type)
Called by the OpenAccess layer to get data type list.

Parameters:
type - Type uses to narrow down the search. SQL_ALL_TYPES indicates ignore it for search.
Returns:
  • SQLDRV_SUCCESS
  • SQLDRV_ERROR