ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/microdataq.htm

72 lines
4.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="DataQueue class" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="microdataq" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>DataQueue class</title>
</head>
<body id="microdataq"><a name="microdataq"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">DataQueue class</h1>
<div><p></p>
<div class="section"><p>The DataQueue class in the micro package (<a href="javadoc/com/ibm/as400/micro/DataQueue.html#NAVBAR_TOP">com.ibm.as400.micro.DataQueue</a>) provides a modified subset
of the functions available in the <a href="dtaq.htm#dtaq">DataQueue class
in the access package</a> (com.ibm.as400.access.DataQueue). Use the DataQueue
class to have your <a href="microconcept.htm#microconcept__tier0">Tier0
device</a> read from or write to a data queue on the iSeries™ server.</p>
<div class="note"><span class="notetitle">Note:</span> To
use ToolboxMe for iSeries classes, you must separately <a href="microsetup.htm#microsetup">download
and set up the ToolboxME for iSeries component</a>.</div>
<p>The DataQueue
class includes the following methods:</p>
<ul><li><a href="javadoc/com/ibm/as400/micro/DataQueue.html#READSTRING(COM.IBM.AS400.MICRO.AS400, JAVA.LANG.STRING)">Read</a> or <a href="javadoc/com/ibm/as400/micro/DataQueue.html#WRITE(COM.IBM.AS400.MICRO.AS400, JAVA.LANG.STRING, JAVA.LANG.STRING)">write</a> an entry as a String</li>
<li><a href="javadoc/com/ibm/as400/micro/DataQueue.html#READBYTES(COM.IBM.AS400.MICRO.AS400, JAVA.LANG.STRING)">Read</a> or <a href="javadoc/com/ibm/as400/micro/DataQueue.html#WRITE(COM.IBM.AS400.MICRO.AS400, JAVA.LANG.STRING, BYTE[])">write</a> an entry as an array of bytes</li>
</ul>
<p>To read or write entries, you need to supply the name of the iSeries server
where the data queue resides and the fully qualified integrated file system
path name of the data queue. When no entries are available, reading an entry
returns a null value.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example: Using DataQueue to read from and write to a data
queue</h4><p>The following example demonstrates how to use the DataQueue
class to read entries from and write entries to a data queue on an iSeries server:</p>
<pre> AS400 system = new AS400("mySystem", "myUserid", "myPwd", "myMEServer");
try
{
// Write to the Data Queue.
DataQueue.write(system, "/QSYS.LIB/FRED.LIB/MYDTAQ.DTAQ", "some text");
// Read from the Data Queue.
String txt = DataQueue.read(system, "/QSYS.LIB/FRED.LIB/MYDTAQ.DTAQ");
}
catch (Exception e)
{
// Handle the exception
}
// Done with the system object.
system.disconnect();
</pre>
</div>
</div>
</body>
</html>