Database interface objects allow ODL programmers to access external databases. You can use a database interface object to:
gather data from a database and store the data in data objects
Gather data from data objects and store the data in a database
Transform data in a filter. Field objects can be compared with database entries and modified if necessary.
Check data in a qualifying object. If the database interface object returns any rows, the qualification is passed.
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.
Defining a database object
To view the database interface, select Tools | Database Interface from the MSG-IDE toolbar.
Select Database Interface from the Classes list and click Add.
Click in the Obj Name field and type a name for the database interface object.
Click in the Dsn field and type the DSN name setup on the current system.
Click in the User field and type the user name to access the database defined in the DSN.
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
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.
To create a new statement object, click New.
To view an existing Statement Object, select the statement and click Details.
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.
To select Status Scope, click its check box.
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. |
![]() |