|
SAP NetWeaver 2004S SPS 09 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sap.mw.jco.JCO
The SAP Java Connector (JCo) package provides an API which enables communication with SAP systems. The toolkit supports client as well as server functionality.
Nested Class Summary | |
static class |
JCO.AbapException
A convenience class on top of JCO.Exception that reports errors which occurred in a SAP system function module |
static class |
JCO.Attributes
Attributes is a class which holds a number of attributes of a connection, such as codepage information, system information of the partner, etc. |
protected static class |
JCO.BASE64
|
static class |
JCO.BasicRepository
The meta data repositories are needed to get the technical description of functions and parameters used for fullfiling of RFC calls. |
static class |
JCO.Client
This object holds all information necessary to establish a connection to a remote JCO server, i.e. either a SAP system or an external JCO compliant server, respectively. |
static class |
JCO.Connection
JCO Client object base class. |
static class |
JCO.ConversionException
JCO conversion exception. |
static class |
JCO.Exception
General JCO exception object. |
static class |
JCO.Field
Class to represent a data field in a record (i.e. parameter list, table, structure). |
static class |
JCO.FieldIterator
Encapsulates an iterator for the fields of a record |
static class |
JCO.Function
Class that represents a function. |
static class |
JCO.FunctionTemplate
Encapsulates all meta data of a function and its import, export, and table parameters. |
protected static class |
JCO.HEX
|
static interface |
JCO.IDocument
Interface for IDoc class libraries. |
static class |
JCO.J2EEAbapException
A convenience class that wraps a JCO.AbapException. |
static class |
JCO.MetaData
Implements the meta data for a data structure, i.e. table, structure, or parameter list, respectively. |
static class |
JCO.ParameterList
A class that encapsulates a parameter list used to pass on data to a function. |
static class |
JCO.Pool
This class encapsulates a connection pool. |
static interface |
JCO.PoolChangedListener
JCO connection listener object This listener will can implemented by an application that is interested in getting information on the changes of a connection pool. |
static class |
JCO.PoolManager
This manager handles all pool objects. |
static class |
JCO.Record
Base class for all data-structures used throughout the JCO toolkit. |
static class |
JCO.Repository
Implementation of the SAP system repository. |
static class |
JCO.Request
A class that encapsulates a request |
static class |
JCO.Response
A class that encapsulates a response |
static class |
JCO.Server
Encapsulates the basic JCO server functionality. |
static interface |
JCO.ServerErrorListener
JCO server error listener interface. |
static interface |
JCO.ServerExceptionListener
JCO server exception listener interface. |
static interface |
JCO.ServerStateChangedListener
JCO server state change listener interface. |
static class |
JCO.ServerThread
This class implements the minimal set of methods which are necessary to embed a JCO.Server. |
static class |
JCO.Structure
Class that encapsulates a composite data structure. |
static class |
JCO.Table
Class that encapsulates a database table |
static class |
JCO.Throughput
JCO Throughput class. |
static interface |
JCO.TraceListener
JCO trace listener interface. |
Field Summary | |
protected static String |
CRLF
Carriage return/ line feed |
static int |
EXPORT_PARAMETER
Flag that indicates a export parameter |
protected static int |
HIDDEN_PARAMETER
Hidden parameter |
static char |
IDOC_VERSION_2
IDOC Version 2 |
static char |
IDOC_VERSION_3
IDOC Version 3 |
static char |
IDOC_VERSION_DEFAULT
IDOC Version default |
static int |
IMPORT_PARAMETER
Flag that indicates an import parameter |
static int |
INACTIVE_PARAMETER
Flag that indicates that the parameter is being excluded from a call |
protected static com.sap.mw.jco.IMiddleware |
middleware
Middleware |
protected static Class |
middleware_class
Middleware class |
protected static String |
middleware_layer
Middleware class |
protected static int |
OMITTED_PARAMETER
Omitted parameter, used in JNI instead of inactive parameter |
static int |
OPTIONAL_PARAMETER
Flag that indicates an optional parameter |
protected static Properties |
properties
|
protected static long |
SERIAL_VERSION_UID
Version for Serializable interface in the format VVvvrrDDMMYYYY |
static byte |
SNC_DEFAULT
Flag for secure network communication, uses built-in default settings |
static byte |
SNC_INTEGRITY
Flag for secure network communication, ensure integrity of each data packet |
static byte |
SNC_MAX
Flag for secure network communication, uses maximal available security |
static byte |
SNC_OPEN
Flag for secure network communication, enables plain text communication, but with authorization |
static byte |
SNC_PRIVACY
Flag for secure network communication, privacy protects each data packet |
static byte |
STATE_BUSY
Flag which indicates that the connection is busy |
static byte |
STATE_CONNECTED
Flag which is being set if the client connection is connected |
static byte |
STATE_DISCONNECTED
Flag which is being set if the connection is in a closed state |
static byte |
STATE_LISTENING
Flag which indicates that the server is listening |
static byte |
STATE_STARTED
Flag which is being set if the server has been started |
static byte |
STATE_STOPPED
Flag which is being set if the server has been stopped |
static byte |
STATE_SUSPENDED
Flag which indicates that the connection has been temporarily suspended |
static byte |
STATE_TRANSACTION
Flag which indicates that the connection is handling a transaction |
static byte |
STATE_USED
Flag which indicates that the client connection is allocated by a pool |
protected static int |
trace_level
The global variables that controls the trace output |
static int |
TYPE_BCD
Packed BCD number, any length between 1 and 16 bytes. |
static int |
TYPE_BYTE
Raw data, binary, fixed length, zero padded. |
static int |
TYPE_CHAR
1-byte or multibyte character. |
static int |
TYPE_DATE
Date ( YYYYYMMDD ). |
static int |
TYPE_EXCEPTION
ABAP exception. |
static int |
TYPE_FLOAT
Floating point,double precision. |
static int |
TYPE_INT
4-byte integer . |
static int |
TYPE_INT1
1-byte integer . |
static int |
TYPE_INT2
2-byte integer . |
static int |
TYPE_INVALID
The field info does not contain a valid JCO data-type |
static int |
TYPE_ITAB
Internal table. |
protected static int |
TYPE_ITEM
|
static int |
TYPE_NUM
Digits, fixed size,'0' padded. |
static int |
TYPE_STRING
Unicode string in UTF8 encoding. |
static int |
TYPE_STRUCTURE
A heterogeneous structure. |
static int |
TYPE_TABLE
A Table. |
static int |
TYPE_TIME
Time (HHMMSS). |
static int |
TYPE_XSTRING
Unicode string in binary encoding. |
static int |
UNINITIALIZED
The field info was not initialized yet |
static int |
UNINITIALIZED_PARAMETER
Flag that indicates an uninitialized parameter |
Constructor Summary | |
protected |
JCO()
Never instantiated directly |
Method Summary | |
static void |
addClientPool(String key,
int max_connections,
Properties properties)
Creates an instance of a client pool to a remote SAP system |
static void |
addClientPool(String key,
int max_connections,
String[][] params)
Creates an instance of a client pool to a remote SAP system using an array to specify the connection parameters. |
static void |
addClientPool(String key,
int max_connections,
String gwhost,
String gwserv,
String tpname)
Creates an instance of a client pool to a remote JCO server program |
static void |
addClientPool(String key,
int max_connections,
String gwhost,
String gwserv,
String tpname,
String tphost)
Creates an instance of a client pool to a remote JCO server program. |
static void |
addClientPool(String key,
int max_connections,
String client,
String user,
String passwd,
String lang,
String ashost,
String sysnr)
Creates an instance of a client pool to a remote SAP system (no load balancing). |
static void |
addClientPool(String key,
int max_connections,
String client,
String user,
String passwd,
String lang,
String mshost,
String r3name,
String group)
Creates an instance of a client pool to a remote SAP system (with load balancing). |
static void |
addClientPool(String key,
int max_connections,
String client,
String user,
String passwd,
String lang,
String ashost,
String sysnr,
String gwhost,
String gwserv)
Creates an instance of a client pool to a remote SAP system (no load balancing). |
static void |
addServerErrorListener(JCO.ServerErrorListener listener)
Adds an error listener to the list of listeners. |
static void |
addServerExceptionListener(JCO.ServerExceptionListener listener)
Adds an exception listener to the list of listeners. |
static void |
addServerStateChangedListener(JCO.ServerStateChangedListener listener)
Adds a state changed listener to the list of listeners. |
static void |
addTraceListener(JCO.TraceListener listener)
Adds a trace listener to the list of listeners |
static JCO.Client |
createClient(Properties properties)
Creates an instance of a client connection to a remote SAP system. |
static JCO.Client |
createClient(String[][] params)
Creates an instance of a client to a remote SAP system using an array to specify the connection parameters. |
static JCO.Client |
createClient(String gwhost,
String gwserv,
String tpname)
Creates an instance of a client connection to a remote RFC server program |
static JCO.Client |
createClient(String gwhost,
String gwserv,
String tpname,
String tphost)
Creates an instance of a client connection to a remote RFC server program |
static JCO.Client |
createClient(String client,
String user,
String passwd,
String lang,
String url)
Creates an instance of a client connection to a remote SAP system (with load balancing) |
static JCO.Client |
createClient(String client,
String user,
String passwd,
String lang,
String ashost,
String sysnr)
Creates an instance of a client connection to a remote SAP system (no load balancing) |
static JCO.Client |
createClient(String client,
String user,
String passwd,
String lang,
String mshost,
String r3name,
String group)
Creates an instance of a client connection to a remote SAP system (with load balancing) |
static JCO.Client |
createClient(String client,
String user,
String passwd,
String lang,
String ashost,
String sysnr,
String gwhost,
String gwserv)
Creates an instance of a client connection to a remote SAP system (no load balancing) |
static JCO.Function |
createFunction(String name,
JCO.ParameterList input,
JCO.ParameterList output,
JCO.ParameterList tables)
Creates a new JCO Function |
static JCO.ParameterList |
createParameterList()
Returns a newly created parameter list |
static JCO.ParameterList |
createParameterList(IMetaData meta_data)
Returns a newly created and preconfigured parameter list as specified by the meta data |
static IRepository |
createRepository(String name,
JCO.Client client)
Creates a new repository |
static IRepository |
createRepository(String name,
String pool_name)
Creates a new repository |
static IRepository |
createRepository(String name,
String[] pool_names)
Creates a new repository |
static JCO.Structure |
createStructure(IMetaData meta_data)
Creates a new structure with data fields as described by the specified meta data |
static JCO.Structure |
createStructure(String name)
Creates a empty structure |
static JCO.Table |
createTable(IMetaData meta_data)
Creates a new table with a column layout as described by the specified meta data |
static JCO.Table |
createTable(String name)
Creates a new table |
protected static void |
fireServerErrorOccurred(JCO.Server server,
Error error)
Calls the error listeners. |
protected static void |
fireServerExceptionOccurred(JCO.Server server,
Exception exception)
Calls the exception listeners. |
protected static void |
fireServerStateChangeOccurred(JCO.Server server,
int old_state,
int new_state)
Calls the registered state changed listeners. |
static void |
fireTrace(int level,
String message)
Issues a trace message. |
static JCO.Client |
getClient(String key)
Returns a client connection from the specified pool. |
static JCO.Client |
getClient(String key,
boolean reset)
Returns a client connection from the specified pool. |
static JCO.PoolManager |
getClientPoolManager()
Returns the pool manager |
protected static byte |
getJCOType(char type)
Converts between RFC and internal types |
protected static char |
getJCOTypeChar(int type)
Converts between internal types and RFC types |
protected static String |
getJCOTypeString(int type)
Converts between internal types and RFC types |
static com.sap.mw.jco.IMiddleware |
getMiddlewareImplementation()
Returns the middleware implementation that is currently loaded Note: This function is for internal use only. |
static String |
getMiddlewareLayer()
Returns the name of the middleware layer that is currently loaded |
static String |
getMiddlewareProperty(String key)
Returns the middleware property for the specifid key or null if not found |
static String[][] |
getMiddlewarePropertyInfo()
Returns information about the properties which are understood by the middleware implementation. |
static String |
getMiddlewareVersion()
Returns the version of the loaded middleware |
static Properties |
getProperties()
Returns properties as set by this implementation |
static String |
getProperty(String key)
Returns the property for the specifid key or null if not found |
static String[][] |
getPropertyInfo()
Returns information about the properties which are understood by the JCO implementation. |
static int |
getTraceLevel()
Returns the trace level |
static String |
getVersion()
Returns the version of the loaded middleware |
static void |
releaseClient(JCO.Client client)
Releases a client connection to its pool. |
static void |
removeClientPool(String key)
Delete a client pool from the pool list. |
static void |
removeServerErrorListener(JCO.ServerErrorListener listener)
Removes an error listener from the list of listeners. |
static void |
removeServerExceptionListener(JCO.ServerExceptionListener listener)
Removes an exception listener from the list of listeners. |
static void |
removeServerStateChangedListener(JCO.ServerStateChangedListener listener)
Removes a state changed listener from the list of listeners. |
static void |
removeTraceListener(JCO.TraceListener listener)
Removes a trace listener from the list of listeners |
static void |
setMiddlewareLayer(String middleware_layer)
Sets the middleware layer to load |
static void |
setMiddlewareProperty(String key,
String value)
Sets a middleware property. |
static void |
setProperty(String key,
String value)
Sets the property for the given key. |
static void |
setTraceLevel(int level)
Sets the trace level |
static void |
setTracePath(String path)
Sets the path to write trace files |
static void |
testCodepage(String codepage)
Deprecated. This method will be removed or modified in the next release. |
static void |
testCodepage(String codepage,
int mode)
Deprecated. This method will be removed or modified in the next release. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final long SERIAL_VERSION_UID
protected static String middleware_layer
protected static Class middleware_class
protected static com.sap.mw.jco.IMiddleware middleware
public static final int UNINITIALIZED
public static final int TYPE_INVALID
public static final int TYPE_CHAR
public static final int TYPE_DATE
public static final int TYPE_BCD
public static final int TYPE_TIME
public static final int TYPE_BYTE
public static final int TYPE_ITAB
public static final int TYPE_NUM
public static final int TYPE_FLOAT
public static final int TYPE_INT
public static final int TYPE_INT2
public static final int TYPE_INT1
public static final int TYPE_STRING
public static final int TYPE_XSTRING
public static final int TYPE_STRUCTURE
public static final int TYPE_TABLE
public static final int TYPE_EXCEPTION
public static final char IDOC_VERSION_DEFAULT
public static final char IDOC_VERSION_2
public static final char IDOC_VERSION_3
protected static final int TYPE_ITEM
public static final int IMPORT_PARAMETER
public static final int EXPORT_PARAMETER
public static final int OPTIONAL_PARAMETER
public static final int UNINITIALIZED_PARAMETER
public static final int INACTIVE_PARAMETER
protected static final int OMITTED_PARAMETER
protected static final int HIDDEN_PARAMETER
public static final byte STATE_DISCONNECTED
public static final byte STATE_CONNECTED
public static final byte STATE_STOPPED
public static final byte STATE_STARTED
public static final byte STATE_BUSY
public static final byte STATE_LISTENING
public static final byte STATE_USED
public static final byte STATE_TRANSACTION
public static final byte STATE_SUSPENDED
public static final byte SNC_OPEN
public static final byte SNC_INTEGRITY
public static final byte SNC_PRIVACY
public static final byte SNC_DEFAULT
public static final byte SNC_MAX
protected static final Properties properties
protected static int trace_level
protected static final String CRLF
Constructor Detail |
protected JCO()
Method Detail |
protected static byte getJCOType(char type)
type
- the type of the field as a single characterprotected static char getJCOTypeChar(int type)
type
- the field typeprotected static String getJCOTypeString(int type)
type
- the field typepublic static void testCodepage(String codepage)
public static void testCodepage(String codepage, int mode)
public static final com.sap.mw.jco.IMiddleware getMiddlewareImplementation()
public static final String getMiddlewareLayer()
public static final void setMiddlewareLayer(String middleware_layer)
middleware_layer
- the middleware layer to loadpublic static final String getVersion()
public static final String[][] getPropertyInfo()
public static final Properties getProperties()
public static final String getProperty(String key)
key
- the property name
public static final void setProperty(String key, String value)
property name | description |
jco.jarm | turns on jARM monitoring (allowed values are 1 or 0) |
jco.jdsr | turns on jDSR monitoring (allowed values are 1 or 0) |
jco.jdsr.comp_name | sets the component name in dsr context |
key
- the property namevalue
- the value of the propertypublic static final String getMiddlewareVersion()
public static final String getMiddlewareProperty(String key)
public static final void setMiddlewareProperty(String key, String value)
key
- the name of the propertyvalue
- the value of the property or null if the property should be removed
Depending on the type of middleware layer loaded, the properties
that will be recognized may vary.
For com.sap.mw.jco.rfc.MiddlewareRFC, i.e. the default RFC
layer, the supported properties are:
jco.middleware.snc_lib | Path to the SNC library |
jco.middleware.wait_for_request_time | Time in seconds to wait incessantly for incoming requests |
jco.middleware.max_startup_delay | Maximum server startup delay time in seconds |
jco.middleware.allow_start_of_programs | List of programs that are allowed to be started by the RFC library |
public static final String[][] getMiddlewarePropertyInfo()
public static int getTraceLevel()
public static void setTraceLevel(int level)
level
- the global trace level. Pass 0 to switch the tracing off.public static void setTracePath(String path)
path
- to write the trace files.
Pass "." to write the trace files in current folder.public static void addTraceListener(JCO.TraceListener listener)
listener
- the listener to addremoveTraceListener(com.sap.mw.jco.JCO.TraceListener)
public static void removeTraceListener(JCO.TraceListener listener)
listener
- the listener to removeaddTraceListener(com.sap.mw.jco.JCO.TraceListener)
public static void fireTrace(int level, String message)
level
- the trace levelmessage
- the trace messagepublic static void addServerExceptionListener(JCO.ServerExceptionListener listener)
listener
- the listener to addremoveServerExceptionListener(com.sap.mw.jco.JCO.ServerExceptionListener)
public static void removeServerExceptionListener(JCO.ServerExceptionListener listener)
listener
- the listener to removeaddServerExceptionListener(com.sap.mw.jco.JCO.ServerExceptionListener)
protected static void fireServerExceptionOccurred(JCO.Server server, Exception exception)
server
- the server in which the exception has occurredexception
- the exception to pass on to the listenerspublic static void addServerErrorListener(JCO.ServerErrorListener listener)
listener
- the listener to addremoveServerErrorListener(com.sap.mw.jco.JCO.ServerErrorListener)
public static void removeServerErrorListener(JCO.ServerErrorListener listener)
listener
- the listener to removeaddServerErrorListener(com.sap.mw.jco.JCO.ServerErrorListener)
protected static void fireServerErrorOccurred(JCO.Server server, Error error)
server
- the server in which the exception has occurrederror
- the error to pass on to the listenerspublic static void addServerStateChangedListener(JCO.ServerStateChangedListener listener)
listener
- the listener to addremoveServerStateChangedListener(com.sap.mw.jco.JCO.ServerStateChangedListener)
public static void removeServerStateChangedListener(JCO.ServerStateChangedListener listener)
listener
- the listener to removeaddServerStateChangedListener(com.sap.mw.jco.JCO.ServerStateChangedListener)
protected static void fireServerStateChangeOccurred(JCO.Server server, int old_state, int new_state)
public static JCO.Client createClient(Properties properties)
properties
- the connection parameters as a property list.
jco.client.client | SAP client |
jco.client.user | Logon user |
jco.client.alias_user | Alias user name |
jco.client.passwd | Logon password |
jco.client.lang | Logon language |
jco.client.sysnr | SAP system number |
jco.client.ashost | SAP application server |
jco.client.mshost | SAP message server |
jco.client.gwhost | Gateway host |
jco.client.gwserv | Gateway service |
jco.client.r3name | R/3 name |
jco.client.group | Group of SAP application servers |
jco.client.tpname | Program ID of external server program |
jco.client.tphost | Host of external server program |
jco.client.type | Type of remote host 2 = R/2, 3 = R/3, E = External |
jco.client.trace | Enable/disable RFC trace (0 or 1) |
jco.client.codepage | Initial codepage in SAP notation |
jco.client.abap_debug | Enable ABAP debugging 0 or 1 |
jco.client.use_sapgui | Use remote SAP graphical user interface (0/1/2) |
jco.client.getsso2 | Get/Don't get a SSO ticket after logon (1 or 0) |
jco.client.mysapsso2 | Use the specified SAP Cookie Version 2 as logon ticket |
jco.client.x509cert | Use the specified X509 certificate as logon ticket |
jco.client.lcheck | Enable/Disable logon check at open time, 1 (enable) or 0 (disable) |
jco.client.grt_data | Additional data for GUI |
jco.client.use_guihost | Host to which to redirect the remote GUI |
jco.client.use_guiserv | Service to which to redirect of the remote GUI |
jco.client.use_guiprogid | Program ID of the server which starts the remote GUI |
jco.client.snc_mode | Secure network connection (SNC) mode, 0 (off) or 1 (on) |
jco.client.snc_partnername | SNC partner, e.g. p:CN=R3, O=XYZ-INC, C=EN |
jco.client.snc_qop | SNC level of security, 1 to 9 |
jco.client.snc_myname | SNC name. Overrides default SNC partner |
jco.client.snc_lib | Path to library which provides SNC service |
jco.client.dest | R/2 destination |
jco.client.saplogon_id | String defined for SAPLOGON on 32-bit Windows |
jco.client.extiddata | Data for external authentication (PAS) |
jco.client.extidtype | Type of external authentication (PAS) |
jco.client.idle_timeout | Idle timeout (in seconds) for the connection after which it will be closed by R/3. Only positive values are allowed. |
jco.client.dsr | Enable/Disable dsr support (0 or 1) |
Note: Depending on the SAP system release, logins using Single-Sign-On (SSO) or X509
certificates are being supported.
For SSO specify the user to be $MYSAPSSO2$ and pass the base64 encoded
ticket as as the passwd parameter.
For X509 specify the user to be $X509CERT$ and pass the base64 encoded
certificate as the passwd parameter.
The logon with SSO or X.509 is based on SNC-encryption and can only be used
in combination with a secure network connection.
public static JCO.Client createClient(String[][] params)
static String[][] login_params = { { "client" , "000" }, { "user" , "johndoe" }, { "passwd" , "whoknows" }, { "lang" , "EN" }, ... }; ... JCO.Client = JCO.createClient(login_params);Note: Depending on the SAP system release, logins using Single-Sign-On (SSO) or X509 certificates are being supported.
params
- the connection parameters as an two-dimemsional arraypublic static JCO.Client createClient(String client, String user, String passwd, String lang, String ashost, String sysnr)
client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languageashost
- Host name of the application serversysnr
- SAP system number
public static JCO.Client createClient(String client, String user, String passwd, String lang, String ashost, String sysnr, String gwhost, String gwserv)
client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languageashost
- Host name of the application serversysnr
- SAP system numbergwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gateway
public static JCO.Client createClient(String client, String user, String passwd, String lang, String mshost, String r3name, String group)
client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languagemshost
- Host name of the message serverr3name
- Name of the SAP systemgroup
- Name of the group of application servers
public static JCO.Client createClient(String client, String user, String passwd, String lang, String url)
client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languageurl
- the url to the remote host
public static JCO.Client createClient(String gwhost, String gwserv, String tpname)
gwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gatewaytpname
- Program ID of an registered RFC server program
public static JCO.Client createClient(String gwhost, String gwserv, String tpname, String tphost)
gwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gatewaytpname
- Program ID of an registered RFC server programtphost
- Host name where the external server runs
public static JCO.PoolManager getClientPoolManager()
public static void addClientPool(String key, int max_connections, String[][] params)
static String[][] login_params = { { "client" , "000" }, { "user" , "johndoe" }, { "passwd" , "whoknows" }, { "language" , "EN" }, ... }; ... JCO.Client = JCO.getClient(MY_POOL);
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.params
- the connection parameters as an two-dimensional array
For a list of supported properties
JCO.Exception
- thrown if a pool with the specified name already existscreateClient(Properties properties)
public static void addClientPool(String key, int max_connections, Properties properties)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.properties
- the connection parameters as a property list
JCO.Exception
- thrown if a pool with the specified name already existscreateClient(Properties properties)
public static void addClientPool(String key, int max_connections, String client, String user, String passwd, String lang, String ashost, String sysnr)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languageashost
- Host name of the application serversysnr
- SAP system number
JCO.Exception
- thrown if a pool with the specified name already existspublic static void addClientPool(String key, int max_connections, String client, String user, String passwd, String lang, String ashost, String sysnr, String gwhost, String gwserv)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languageashost
- Host name of the application servergwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gatewaysysnr
- SAP system number
JCO.Exception
- thrown if a pool with the specified name already existspublic static void addClientPool(String key, int max_connections, String client, String user, String passwd, String lang, String mshost, String r3name, String group)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.client
- SAP logon clientuser
- SAP logon userpasswd
- SAP logon passwordlang
- SAP logon languagemshost
- Host name of the message serverr3name
- Name of the SAP systemgroup
- Name of the group of application servers
JCO.Exception
- thrown if a pool with the specified name already existspublic static void addClientPool(String key, int max_connections, String gwhost, String gwserv, String tpname)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.gwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gatewaytpname
- Program ID of an registered JCO server program
JCO.Exception
- thrown if a pool with the specified name already existspublic static void addClientPool(String key, int max_connections, String gwhost, String gwserv, String tpname, String tphost)
key
- the name of the poolmax_connections
- max. number of connections allowed for the pool.gwhost
- Host name of the SAP gatewaygwserv
- Service number of the SAP gatewaytpname
- Program ID of an registered JCO server programtphost
- Host name where the external server runs
JCO.Exception
- thrown if a pool with the specified name already existspublic static void removeClientPool(String key)
key
- the name of the poolpublic static JCO.Client getClient(String key)
max_wait_time
ms
until an other thread releases a client. If no clients are released during the waiting
and a client could not be allocated, a pool throws JCO.Exception with the error
group set to JCO.Exception.JCO_ERROR_RESOURCE.This method is similar to JCO.getClient([key], false)
Note: To avoid reconnect on connections to the SAP Systems below 4.0A or reset on connections to the SAP systems 4.0A and above it is necessary to set the resetOnRelease property to false and use JCO.getClient([pool name], false). Be careful, if you use this way, if have to be certain, that the application using this pool never invokes functions, that maintain a state on the ABAP server.
Note: Any client obtained by this method must be released with JCO.releaseClient()
key
- the name of the pool from which to take the connection from
JCO.Exception
- with the error group set to JCO.Exception.JCO_ERROR_RESOURCE,
if a client could not be allocated, i.e. the client pool is exhausted
JCO.Exception
- thrown if a client connection could not be established due to wrong logon data,
network problems, etc.releaseClient(com.sap.mw.jco.JCO.Client)
,
JCO.PoolManager.setMaxWaitTime(long)
,
getClient(String, boolean)
public static JCO.Client getClient(String key, boolean reset)
key
- the name of the pool from which to take the connection fromreset
- if true reset the connection, e.g. free all resources
that might have been allocated on either the server side or by the local
middleware library. On systems below SAP system 4.0A resetting a connection
effectively means closing and subsequently reopening the connection
which is a very expensive process. However, several scenarios
(e.g. BAPIs) might need such reinitialized connections.JCO.Exception
- with the error group set to JCO.Exception.JCO_ERROR_RESOURCE,
if a client could not be allocated, i.e. the client pool is exhausted
JCO.Exception
- thrown if a client connection could not be established due to wrong logon data,
network problems, etc.releaseClient(com.sap.mw.jco.JCO.Client)
public static void releaseClient(JCO.Client client)
client
- the client to be released to the pool
JCO.Exception
- thrown if a connection could not be released cleanlygetClient(java.lang.String)
,
JCO.Pool.setResetOnRelease(boolean)
public static JCO.ParameterList createParameterList()
public static JCO.ParameterList createParameterList(IMetaData meta_data)
public static JCO.Structure createStructure(String name)
name
- the name of the structurepublic static JCO.Structure createStructure(IMetaData meta_data)
meta_data
- the meta data which describe the layout of the structurepublic static JCO.Table createTable(String name)
name
- the name of the tablepublic static JCO.Table createTable(IMetaData meta_data)
meta_data
- the meta data which describe the columns of the tablepublic static JCO.Function createFunction(String name, JCO.ParameterList input, JCO.ParameterList output, JCO.ParameterList tables)
name
- the name of the functioninput
- the list of import parametersoutput
- the list of export parameterstables
- the list of table parameters
public static IRepository createRepository(String name, String pool_name)
name
- the name of the new repositorypool_name
- the name of the client pool which the repository uses to
dynamically query the remote SAP system dictonary.public static IRepository createRepository(String name, String[] pool_names)
name
- the name of the new repositorypool_names
- the names of the client pools which the repository uses to
dynamically query the remote SAP system dictonary.public static IRepository createRepository(String name, JCO.Client client)
name
- the name of the new repositoryclient
- the client used to dynamically access the SAP system dictonary
|
SAP NetWeaver 2004S SPS 09 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |