public final class JConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ENC_OFF
Encryption off
|
static int |
ENC_REQUIRED
Encryption required
|
static int |
ENC_SUPPORTED
Encryption supported
|
static int |
EXEC_GET_CAPTURE
Passed to execute() or executeAndStore() to retrieve the
capture string returned by executed command
|
static int |
EXEC_GET_RETURNLIST
Passed to execute() or executeAndStore() to retrieve the
list returned by executed command
|
static int |
EXEC_GET_RETURNSTRING
Passed to execute() or executeAndStore() to retrieve the
return string of executed command
|
Constructor and Description |
---|
JConnection() |
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction(java.lang.String transText)
Aborts the active transaction
|
JCommon |
attachCommon(int numVars,
java.lang.String name)
Attaches a common block by name with a given number of variables
|
void |
call(java.lang.String subName)
Calls a host-side subroutine passing it no parameters
|
void |
call(java.lang.String subName,
JDynArray[] parms)
Calls a host-side subroutine with given parameters
|
void |
call(java.lang.String subName,
java.lang.String[] parms)
Calls a host-side subroutine with given parameters
|
void |
close()
Closes the connection and ends the server-side jRCS proxy process
|
void |
deleteList(java.lang.String name)
Deletes the specified list from a work file
|
void |
endTransaction(java.lang.String transName)
Ends the active transaction
|
void |
execute(java.lang.String command)
Executes a jCL/jQL command ignoring its results
|
JExecuteResults |
execute(java.lang.String command,
int flags)
Executes a jCL/jQL command and retrieves select
parameters resulting from execution
|
JExecuteResults |
execute(java.lang.String command,
int flags,
JSelectList passList)
Executes a jCL/jQL command optionally passing it a select list
and retrieves select parameters resulting from execution
|
JExecuteResults |
executeAndStore(java.lang.String command,
int flags)
Executes a jCL/jQL command and retrieves select parameters resulting
from execution.
|
JExecuteResults |
executeAndStore(java.lang.String command,
int flags,
JSelectList passList)
Executes a jCL/jQL command optionally passing it a select list
and retrieves select parameters resulting from execution.
|
JExecuteResults |
executeAndStore(java.lang.String command,
int flags,
JSelectList passList,
int blockSize)
Executes a jCL/jQL command optionally passing it a select list
and retrieves select parameters resulting from execution.
|
char |
getAM()
Retrieves the attribute mark character for this connection
|
java.lang.String |
getCodePage()
Reserved for future use
|
protected com.jbase.jrcs.JConnector |
getConnector() |
int |
getDataEncryptionLevel() |
int |
getDate()
Returns server date as an integer in internal format
|
java.nio.charset.Charset |
getHostCharacterEncoding()
Returns the character set used to map Unicode strings onto
byte sequences passed to the host and read from the host.
|
JDynArray |
getjBaseVersion()
Retrieves the version of jBASE database connected to this
JConnection object
|
JSelectList |
getList(java.lang.String name)
Retrieves the specified list from a work file
|
java.lang.String |
getLocale()
Reserved for future use
|
int |
getPasswordEncryptionLevel() |
int |
getPort()
Returns the jBASE port number (PIB) assigned to the logged on
session
|
char |
getSVM()
Retrieves the subvalue mark character for this connection
|
JIOHandler |
getTermIOHandler()
Retrieves a reference to the current terminal I/O handler
|
int |
getTime()
Retrieves the current server time as an integer in internal format
|
char |
getVM()
Retrieves the value mark character for this connection
|
java.lang.String |
iConv(java.lang.String source,
java.lang.String code)
Performs an input conversion of a string using a conversion code
|
java.lang.String |
oConv(java.lang.String source,
java.lang.String code)
Performs an output conversion of a string using a conversion code
|
void |
open(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password,
java.lang.String accountName)
Opens a TCP/IP connection to the given host and port and
establishes a jRCS logon session with specified user name,
password and account name
|
void |
open(java.lang.String host,
java.lang.String userName,
java.lang.String password)
Opens a TCP/IP connection to the given host and default jRCS port and
establishes a jRCS logon session with specified user name
and password
|
JFile |
openFile(java.lang.String fileName)
Opens a file with the given name
|
void |
setDataEncryptionLevel(int dataEncryptionLevel)
Sets the current data encryption level.
|
void |
setHostCharacterEncoding(java.nio.charset.Charset charSet)
Sets the character set used to map Unicode strings onto
byte sequences passed to the host and read from the host.
|
void |
setPasswordEncryptionLevel(int passwordEncryptionLevel)
Sets the current password encryption level.
|
void |
setTermIOHandler(JIOHandler handler)
Sets a terminal I/O handler
|
void |
startTransaction(boolean sync,
java.lang.String transText)
Starts a transaction
|
public static final int EXEC_GET_CAPTURE
public static final int EXEC_GET_RETURNSTRING
public static final int EXEC_GET_RETURNLIST
public static final int ENC_REQUIRED
public static final int ENC_SUPPORTED
public static final int ENC_OFF
public void abortTransaction(java.lang.String transText) throws JException
transText
- Text to be stored in the transaction file. This
parameter can be a blank string ("")JException
public char getAM()
public char getVM()
public char getSVM()
public JCommon attachCommon(int numVars, java.lang.String name) throws JException
numVars
- Number of variables in the common blockname
- Name of the common block. To attach an unnamed common
specify a blank string ("")JException
public void call(java.lang.String subName, java.lang.String[] parms) throws JException
subName
- Subroutine nameparms
- An array of subroutine parameters. The number of
parameters must exactly match the jBC signature of the subroutineJException
public void call(java.lang.String subName) throws JException
subName
- Subroutine nameJException
public void call(java.lang.String subName, JDynArray[] parms) throws JException
subName
- Subroutine nameparms
- An array of subroutine parameters in the form of dynamic
arrays. The number of parameters must exactly match the jBC signature
of the subroutineJException
public void close() throws JException
JException
public java.lang.String getCodePage()
public int getDate() throws JException
JException
public void deleteList(java.lang.String name) throws JException
name
- Name of list to deleteJException
public void endTransaction(java.lang.String transName) throws JException
transName
- Text to be stored in the transaction file. This
parameter can be a blank string ("")JException
public JSelectList getList(java.lang.String name) throws JException
name
- Name of list to retrieveJException
public java.lang.String iConv(java.lang.String source, java.lang.String code) throws JException
source
- String to convertcode
- Conversion codeJException
public JDynArray getjBaseVersion() throws JException
JException
public java.lang.String getLocale() throws JException
JException
public java.lang.String oConv(java.lang.String source, java.lang.String code) throws JException
source
- String to convertcode
- Conversion codeJException
public void open(java.lang.String host, int port, java.lang.String userName, java.lang.String password, java.lang.String accountName) throws JException
host
- Host name or IP address to connect toport
- IP port number to connect to. Use JConstants.JRCS_PORT for the default port numberuserName
- User namepassword
- User's passwordaccountName
- Account name. This parameter can be a blank string
(""). In this case the logon is performed to the home directory of
the user specified by the userName parameterJException
public void open(java.lang.String host, java.lang.String userName, java.lang.String password) throws JException
host
- Host name or IP address to connect touserName
- User namepassword
- User's passwordJException
public JFile openFile(java.lang.String fileName) throws JException
fileName
- Name of file to open. The names are case-sensitive
on UNIX-like systems. You may specify DICT in front of the name
to open the dictionary portion of the fileJException
public int getPort() throws JException
JException
public void startTransaction(boolean sync, java.lang.String transText) throws JException
sync
- Forces the subsequent end or abort of the transaction to
flush all database updatestransText
- Text to be stored in the transaction file. You can
specify an empty string ("")JException
public int getTime() throws JException
JException
protected com.jbase.jrcs.JConnector getConnector() throws JException
JException
public JExecuteResults execute(java.lang.String command, int flags, JSelectList passList) throws JException
command
- Command to executeflags
- A bit mask specifying parameters to return from the host
This can be any of the following:
EXEC_GET_CAPTURE - retrieves the capture string
EXEC_GET_RETURNLIST - retrieves the select list generated by the command
EXEC_GET_RETURNSTRING - retrieves the return string
passList
- Select list to be passed to the command. This parameter
can be nullJException
public JExecuteResults execute(java.lang.String command, int flags) throws JException
command
- Command to executeflags
- A bit mask specifying parameters to return from the host.
See execute(String, int, JSelectList)
JException
public void execute(java.lang.String command) throws JException
command
- Command to executeJException
public JExecuteResults executeAndStore(java.lang.String command, int flags, JSelectList passList, int blockSize) throws JException
command
- Command to executeflags
- A bit mask specifying parameters to return from the host
This can be any of the following:
EXEC_GET_RETURNLIST - retrieves the select list generated by the command
EXEC_GET_RETURNSTRING - retrieves the return string
passList
- Select list to be passed to the command. This parameter
can be nullblockSize
- Initial block size for the captureJException
public JExecuteResults executeAndStore(java.lang.String command, int flags, JSelectList passList) throws JException
command
- Command to executeflags
- A bit mask specifying parameters to return from the host.
See executeAndStore(String, int, JSelectList, int)
passList
- Select list to be passed to the command. This parameter
can be nullJException
public JExecuteResults executeAndStore(java.lang.String command, int flags) throws JException
command
- Command to executeflags
- A bit mask specifying parameters to return from the host.
See executeAndStore(String, int, JSelectList, int)
JException
public JIOHandler getTermIOHandler()
public void setTermIOHandler(JIOHandler handler)
handler
- New terminal I/O handler or null to use the defaultpublic java.nio.charset.Charset getHostCharacterEncoding()
public void setHostCharacterEncoding(java.nio.charset.Charset charSet)
charSet
- A Charset object used to perform character mapping.
If this parameter is null, the encoding defaults to Windows Latin-1.public int getDataEncryptionLevel()
public void setDataEncryptionLevel(int dataEncryptionLevel) throws JException
dataEncryptionLevel
- Data encryption level to set (ENC_REQUIRED to ENC_OFF)JException
- Encryption level specified is invalid or connection is already activepublic int getPasswordEncryptionLevel()
public void setPasswordEncryptionLevel(int passwordEncryptionLevel) throws JException
passwordEncryptionLevel
- Password encryption level to set (ENC_REQUIRED to ENC_OFF)JException
- Encryption level specified is invalid or connection is already active