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

84 lines
5.3 KiB
HTML

<?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="UserSpace 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="uspace" />
<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>UserSpace class</title>
</head>
<body id="uspace"><a name="uspace"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">UserSpace class</h1>
<div><p></p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/access/UserSpace.html#NAVBAR_TOP"> UserSpace</a> class represents a user space on the server.
Required parameters are the name of the user space and the <a href="javadoc/com/ibm/as400/access/AS400.html#NAVBAR_TOP">AS400</a> object
that represents the server that has the user space. Methods exist in user
space class to do the following:</p>
</div>
<div class="section"><ul><li><a href="javadoc/com/ibm/as400/access/UserSpace.html#CREATE(INT, BOOLEAN, JAVA.LANG.STRING, BYTE, JAVA.LANG.STRING, JAVA.LANG.STRING)"> Create</a> a user space.</li>
<li><a href="javadoc/com/ibm/as400/access/UserSpace.html#DELETE()"> Delete</a> a user space.</li>
<li><a href="javadoc/com/ibm/as400/access/UserSpace.html#READ(BYTE[], INT)"> Read</a> from a user space.</li>
<li><a href="javadoc/com/ibm/as400/access/UserSpace.html#WRITE(BYTE[], INT)"> Write</a> to user space.</li>
<li>Get the attributes of a user space. A Java™ program can get the <a href="javadoc/com/ibm/as400/access/UserSpace.html#GETINITIALVALUE()"> initial
value</a>, <a href="javadoc/com/ibm/as400/access/UserSpace.html#GETLENGTH()">length value</a>, and <a href="javadoc/com/ibm/as400/access/UserSpace.html#ISAUTOEXTENDIBLE()"> automatic extendible</a> attributes of a user space.</li>
<li>Set the attributes of a user space. A Java program can set the <a href="javadoc/com/ibm/as400/access/UserSpace.html#SETINITIALVALUE(BYTE)"> initial
value</a>, <a href="javadoc/com/ibm/as400/access/UserSpace.html#SETLENGTH(INT)">length value</a>, and <a href="javadoc/com/ibm/as400/access/UserSpace.html#SETAUTOEXTENDIBLE(BOOLEAN)"> automatic extendible</a> attributes of a user space.</li>
</ul>
</div>
<div class="section"><p>The UserSpace object requires the integrated file system path
name of the program. See <a href="ifspath.htm#ifspath">integrated file
system path names</a> for more information.</p>
</div>
<div class="section"><p>Using the UserSpace class causes the AS400 object to connect to
the server. See <a href="mngcon.htm#mngcon">managing connections</a> for
information about managing connections. </p>
</div>
<div class="section"><div class="p"><span class="synph" id="uspace__uspex1"><a name="uspace__uspex1"><!-- --></a><span class="kwd"></span></span>The following example creates
a user space, then writes data to it. <div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm#codedisclaimer">Code
example disclaimer</a> for important legal information.</div>
</div>
</div>
<div class="section"><div class="p"><pre> // Create an AS400 object.
AS400 sys = new AS400("mySystem.myCompany.com");
// Create a user space object.
UserSpace US = new UserSpace(sys,
"/QSYS.LIB/MYLIB.LIB/MYSPACE.USRSPC");
// Use the create method to create the user space on
// the server.
US.create(10240, // The initial size is 10KB
true, // Replace if the user space already exists
" ", // No extended attribute
(byte) 0x00, // The initial value is a null
"Created by a Java program", // The description of the user space
"*USE"); // Public has use authority to the user space
// Use the write method to write bytes to the user space.
US.write("Write this string to the user space.", 0);
</pre>
</div>
</div>
</div>
</body>
</html>