Defining distributed function objects  Using a SQL template and a datalink

Chapter 3: Using MSG-IDE

Defining database interface objects

Database interface objects allow ODL programmers to access external databases. You can use a database interface object to:

You can write SQL to use the contents of a data object as a comparison point for selecting rows of data, then bind columns of the result row to data objects and manipulate data objects with the callback function. For example, you can put a last name in a data object, then use the last name to draw a row from a database of last name-salary-phone number information. Bind the salary column to another data object, and use the callback function to send the last name and salary to the message broker for distribution to an endpoint application.

StepsDefining a database object

  1. To view the database interface, select Tools | Database Interface from the MSG-IDE toolbar.

  2. Select Database Interface from the Classes list and click Add.

  3. Click in the Obj Name field and type a name for the database interface object.

  4. Click in the Dsn field and type the DSN name setup on the current system.

  5. Click in the User field and type the user name to access the database defined in the DSN.

  6. Click in the Password field and type the associated password.

    The nnsyreg.dat file entry should look similar to the following example, for a SQL 8.0 database on Windows 2000:

    OTContext.InputContext
    
    NNOT_CTX_TMID			= OTTestTransactionManager
    
    NNOT_CTX_ENFORCE_TX		= TRUE
    
    
    
    OTContext.OutputContext1
    
    NNOT_CTX_TMID			= OTTestTransactionManager2
    
    NNOT_CTX_ENFORCE_TX		= TRUE
    
    
    
    OTContext.OutputContext2
    
    NNOT_CTX_TMID			= OTTestTransactionManager
    
    NNOT_CTX_ENFORCE_TX		= TRUE
    
    
    
    Transport.TransportInput
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSQueueFactory
    
    NNOT_TIL_OPEN_SESSION_ID	= MQSession
    
    
    
    Transport.TransportError
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSQueueFactory
    
    NNOT_TIL_OPEN_SESSION_ID	= MQSession2
    
    
    
    Transport.TransportOutput1
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSQueueFactory
    
    NNOT_TIL_OPEN_SESSION_ID	= MQSession
    
    
    
    Transport.TransportOutput2
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSQueueFactory
    
    NNOT_TIL_OPEN_SESSION_ID	= MQSession
    
    TransactionManager.OTTestTransactionManager
    
    NNOT_SHARED_LIBRARY		= oti26mqstm
    
    NNOT_FACTORY_FUNCTION		= NNOTMQSeriesTXManagerFactory
    
    NN_TM_MQS_QMGR			= QUEUEMGR
    
    
    
    TransactionManager.OTTestTransactionManager2
    
    NNOT_SHARED_LIBRARY		= oti26mqstm
    
    NNOT_FACTORY_FUNCTION		= NNOTMQSeriesTXManagerFactory
    
    NN_TM_MQS_QMGR			= QUEUEMGR
    
    
    
    Session.MQSession
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSSessionFactory
    
    NNMQS_SES_OPEN_QMGR		= QUEUEMG
    
    
    
    Session.MQSession2
    
    NNOT_SHARED_LIBRARY		= dbt26mqs
    
    NNOT_FACTORY_FUNCTION		= NNMQSSessionFactory
    
    NNMQS_SES_OPEN_QMGR		= QUEUEMGR
    
  7. The Statements pane displays a list of the statement objects in the database interface object. A statement object comprises SQL statements and other settings that perform an action involving the database. The statement objects apply only to the database to which the database interface object is linked.

  8. Click the drop-down list in the Isolation Level field to select an isolation level.

    The isolation level is the method used to deal with concurrent data calls to the database. Refer to the ODBC manuals provided by your DBMS or database middleware vendor for information on isolation levels.

  9. To select Status Scope, click its check box.

  10. Click OK to accept the settings in the database interface object dialog box and close the dialog box.





Copyright © 2005. Sybase Inc. All rights reserved. Using a SQL template and a datalink

View this book as PDF