Problem solve Get help with specific problems with your technologies, process and projects.

Data queue from Java

How does one address a data queue from Java?

Here's a sample code:

         // Access an existing non-empty data queue 
         KeyedDataQueue dq = new KeyedDataQueue(systemObject_, "/QSYS.LIB/MYLIB.LIB/MYDQ.DTAQ"); 
         // Create a metadata object. 
         ListMetaData metaData = new ListMetaData(2); 
         // Set first column to be the customer ID. 
         metaData.setColumnName(0, "Customer ID"); 
         metaData.setColumnLabel(0, "Customer ID"); 
         metaData.setColumnType(0, RowMetaDataType.STRING_DATA_TYPE); 
         // Set second column to be the order to be processed. 
         metaData.setColumnName(1, "Order Number"); 
         metaData.setColumnLabel(1, "Order Number"); 
         metaData.setColumnType(1, RowMetaDataType.STRING_DATA_TYPE); 
         // Create a ListRowData object. 
         ListRowData rowData = new ListRowData(); 
         // Get the entries off the data queue. 
         KeyedDataQueueEntry data = dq.read(key, 0, "EQ"); 
         while (data != null) 
            // Add queue entry to row data object. 
            Object[] row = new Object[2]; 
            row[0] = new String(key); 
            row[1] = new String(data.getData()); 
            // Get another entry from the queue. 
            data = dq.read(key, 0, "EQ"); 
// finish program here *** 


The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

This was last published in July 2002

Dig Deeper on iSeries COBOL programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.