Exemple #1
0
        /*
        ** Name: getGeneratedKeys
        **
        ** Description:
        **	Retrieve table and/or object keys
        **
        ** Input:
        **	None.
        **
        ** Output:
        **	None.
        **
        ** Returns:
        **	ResultSet   Result-set containing table/object keys
        **
        ** History:
        **	21-Feb-03 (gordy)
        **	    Created.
        **	 3-Jul-03 (gordy)
        **	    Set DBMS types to LOGKEY/TBLKEY.
        **	26-Sep-03 (gordy)
        **	    Result-set data now stored as SqlByte SqlData objects.
        */
        public AdvanRslt getGeneratedKeys()
        {
            lock(this)
            {
                ResultSet	rs = rsEmpty;
                SqlData[][]	data;
                SqlByte	bytes;

                if ( rslt_tblkey )
                    if ( rslt_objkey )
                    {
                        if ( rsmdKeys == null )
                        {
                            rsmdKeys = new AdvanRSMD( (short)2, trace );
                            rsmdKeys.setColumnInfo( "table_key", 1, (int)Types.BINARY,
                                (short)DBMS_TYPE_TBLKEY,
                                (short)MSG_RPV_TBLKEY_LEN,
                                (byte)0, (byte)0, false );
                            rsmdKeys.setColumnInfo( "object_key", 2, (int)Types.BINARY,
                                (short)DBMS_TYPE_LOGKEY,
                                (short)MSG_RPV_OBJKEY_LEN,
                                (byte)0, (byte)0, false );
                        }

                        data = new SqlData[1][];
                        data[0] = new SqlData[2];

                        bytes = new SqlByte( MSG_RPV_TBLKEY_LEN );
                        bytes.put( rslt_val_tblkey );
                        data[0][0] = bytes;

                        bytes = new SqlByte( MSG_RPV_OBJKEY_LEN );
                        bytes.put( rslt_val_objkey );
                        data[0][1] = bytes;

                        rs = new RsltData( conn, rsmdKeys, data );
                    }
                    else
                    {
                        if ( rsmdTblKey == null )
                        {
                            rsmdTblKey = new AdvanRSMD( (short)1, trace );
                            rsmdTblKey.setColumnInfo( "table_key", 1, (int)Types.BINARY,
                                (short)DBMS_TYPE_TBLKEY,
                                (short)MSG_RPV_TBLKEY_LEN,
                                (byte)0, (byte)0, false );
                        }

                        data = new SqlData[1][];
                        data[0] = new SqlData[1];

                        bytes = new SqlByte( MSG_RPV_TBLKEY_LEN );
                        bytes.put( rslt_val_tblkey );
                        data[0][0] = bytes;

                        rs = new RsltData( conn, rsmdTblKey, data );
                    }
                else  if ( rslt_objkey )
                {
                    if ( rsmdObjKey == null )
                    {
                        rsmdObjKey = new AdvanRSMD( (short)1, trace );
                        rsmdObjKey.setColumnInfo( "object_key", 1, (int)Types.BINARY,
                            (short)DBMS_TYPE_LOGKEY,
                            (short)MSG_RPV_OBJKEY_LEN,
                            (byte)0, (byte)0, false );
                    }

                    data = new SqlData[1][];
                    data[0] = new SqlData[1];

                    bytes = new SqlByte( MSG_RPV_OBJKEY_LEN );
                    bytes.put( rslt_val_objkey );
                    data[0][0] = bytes;

                    rs = new RsltData( conn, rsmdObjKey, data );
                }
                else  if ( rsEmpty == null )
                {
                    if ( rsmdEmpty == null )
                    {
                        rsmdEmpty = new AdvanRSMD( (short)1, trace );
                        rsmdEmpty.setColumnInfo( "no_key", 1, (int)Types.BINARY,
                            (short)DBMS_TYPE_TBLKEY,
                            (short)MSG_RPV_TBLKEY_LEN,
                            (byte)0, (byte)0, false );
                    }

                    rs = rsEmpty = new RsltData( conn, rsmdEmpty, null );
                }

                if ( trace.enabled() )  trace.log( title + ".getGeneratedKeys: " + rs );
                return( rs );
            }
        }
Exemple #2
0
 /*
 ** Name: getParameterMetaData
 **
 ** Description:
 **	Returns meta-data object describing the input parameters.
 **
 **	Ingres does not support DESCRIBE INPUT.
 **
 ** Input:
 **	None.
 **
 ** Output:
 **	None.
 **
 ** Returns:
 **	ParameterMetaData   Parameter meta-data.
 **
 ** History:
 **	19-Feb-03 (gordy)
 **	    Created.
 */
 //        public ParameterMetaData
 //            getParameterMetaData()
 //        {
 //            if ( trace.enabled() )  trace.log( title + ".getParameterMetaData()" );
 //            throw SqlEx.get( ERR_GC4019_UNSUPPORTED );
 //        } // getParameterMetaData
 /*
 ** Name: getResultSetEmpty
 **
 ** Description:
 **	Returns an empty result set with metdata (rsmd) filled in.
 **
 ** Input:
 **	None.
 **
 ** Output:
 **	None.
 **
 ** Returns:
 **	RsltData   An empty result set with metdata (rsmd) filled in.
 **
 ** History:
 **	13-Oct-05 (thoda04)
 **	    Created.
 */
 internal RsltData getResultSetEmpty()
 {
     RsltData  resultset = new RsltData(conn, getMetaData(), null);
     return resultset;
 }