com.rocketsoftware.mvapi
Class MVConnection

java.lang.Object
  extended by com.rocketsoftware.mvapi.AbstractConnection
      extended by com.rocketsoftware.mvapi.MVConnection
All Implemented Interfaces:
java.sql.Connection

public class MVConnection
extends AbstractConnection

Implements connection methods for an MV server.


Field Summary
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
MVConnection()
          Default constructor.
MVConnection(java.lang.String host, int port, java.lang.String user, java.lang.String pwd)
          Constructs a connection object using a host name, port number, user and password.
MVConnection(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, boolean sslConnect, boolean licEnterprise)
          Constructs a connection object using a host name, port number, user and password.
MVConnection(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String account, boolean sslConnect, boolean licEnterprise)
          Constructs a connection object using a host name, port number, user and password.
MVConnection(java.lang.String host, int port, java.lang.String user, java.lang.String pwd, java.lang.String account, boolean sslConnect, MVConstants.LicenseType licenseType)
          Constructs a connection object using a host name, port number, user and password.
MVConnection(java.lang.String url, java.util.Properties props)
          Creates a connection object to the url with the provided properties.
 
Method Summary
 java.lang.String call(java.lang.String name, java.util.List<java.lang.String> arguments)
          Calls a mvSub.
 java.lang.String call(java.lang.String name, java.lang.String data)
          Calls a mvSub.
 void clearSelect()
          Clears an active select list.
 void close()
          Releases this Connection object's database resources
 void closeConnection()
          Closes the connection.
 boolean connect()
          Connects to the server.
 int count(java.lang.String stringToSearch, char charToCount)
          Counts character occurances in another string.
 MVStatement createStatement()
          Creates a Statement object for sending AQL or TCL statements to the database.
 int dCount(java.lang.String dArray, char delim)
          This function returns how many elements of the type indicated by delim are contained in the given dynamic array.
 java.lang.String delete(java.lang.String dArray, int attrNum)
          Delete attribute from dynamic array
 java.lang.String delete(java.lang.String dArray, int attrNum, int valNum)
          Deletes a value from the dynamic array.
 java.lang.String delete(java.lang.String dArray, int attrNum, int valNum, int subValNum)
          Deletes a sub value from a dynamic array.
 void execute(java.lang.String command)
          Executes a command and populates the "capturing" and "returning" results.
 void execute(java.lang.String command, java.lang.String data)
          Executes a command and populates the "capturing" and "returning" results.
 MVResultSet executeQuery(java.lang.String query)
          Queries the MV database.
 java.lang.String extract(java.lang.String dArray, int attrNum)
          Dynamic array reference
 java.lang.String extract(java.lang.String dArray, int attrNum, int valNum)
          Dynamic array reference
 java.lang.String extract(java.lang.String dArray, int attrNum, int valNum, int subValNum)
          Dynamic array references
 java.lang.String field(java.lang.String dArray, java.lang.String delim, int pos)
          Extracts a substring from the dynamic array.
 boolean fileCacheRelease(java.lang.String path)
          Releases the associated file cache entry for the specified opened file on the MVSP server.
 java.lang.String fileDelete(java.lang.String path, java.lang.String itemId)
          Deletes an item from the file.
 java.lang.String fileRead(java.lang.String path, java.lang.String itemId)
          Reads an item from the file.
 java.lang.String fileReadNext()
          Gets the next item ID from the current fileSELECT list.
 java.lang.String fileReadU(java.lang.String path, java.lang.String itemId)
          Reads an item from the file, setting an itemlock.
 java.lang.String fileReadV(java.lang.String path, java.lang.String itemId, int attribute)
          Reads an item's attribute value from the file.
 java.lang.String fileReadVU(java.lang.String path, java.lang.String itemId, int attribute)
          Reads an item's attribute value from the file, setting an item lock.
 java.lang.String fileRelease(java.lang.String path, java.lang.String itemId)
          Releases an item lock set by a prior fileReadU.
 boolean fileSelect(java.lang.String path)
          Selects the file specified by path for a subsequent fileReadNext.
 java.lang.String fileWrite(java.lang.String path, java.lang.String itemId, java.lang.String itemBody)
          Writes an item to the file, releasing the update lock set by a previous fileReadU of the same item.
 java.lang.String fileWriteU(java.lang.String path, java.lang.String itemId, java.lang.String itemBody)
          Writes an item to the file, keeping update lock set by a previous fileReadU of the same item.
 java.lang.String fileWriteV(java.lang.String path, java.lang.String itemId, java.lang.String attributeValue, int attribute)
          Writes a value to an item's attribute.
 java.lang.String fileWriteVU(java.lang.String path, java.lang.String itemId, java.lang.String attributeValue, int attribute)
          Writes a value to an item's attribute, keeping update lock set by a previous fileReadU/fileReadVU of the same item.
 java.lang.String getConnectionProperties()
           
 MVConnector getConnector()
          Returns the connector object.
 java.lang.String getCurrentAccount()
          Gets the current logged to account.
 java.lang.String getCurrentAccountPwd()
          Gets the current logged to account password.
 boolean getEol()
          Checks for end of list, i.e., will READNEXT fail.
 java.lang.String getExecuteCapturing()
          Returns the captured result of an execute statement (execute command capturing result).
 java.lang.String getExecuteReturning()
          Returns the returning result of an execute statement (execute command returning result).
 int getFileStatusCode()
           
 java.lang.String getFileStatusMessage()
          If getFileStatusCode returns non-zero, mvCall this to get a textual error message.
 java.lang.String getRuleModule()
          Gets the rulename you had set via setRuleName
 java.lang.String getServerEnvironment()
          Gets the server's environment setting.
 java.lang.String getServerPlatform()
          Gets the server's platform name.
 java.lang.String getServerPort()
          Gets the server connect information (port number on D3/MV).
 java.lang.String getServerVersion()
          Gets the MVSP version.
 java.lang.String insert(java.lang.String dArray, int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Inserts a sub value into a dynamic array.
 java.lang.String insert(java.lang.String dArray, int attrNum, int valNum, java.lang.String value)
          Inserts a value into a dynamic array.
 java.lang.String insert(java.lang.String dArray, int attrNum, java.lang.String attribute)
          Inserts an attribute into a dynamic array.
 boolean isClosed()
           
 boolean isConnected()
          Checks current connection state.
 boolean isConnectionPooled()
          Determines if the connection is pooled.
 boolean isConnectionPoolingSupported()
           
 boolean isFileExistCmdSupported()
          Checks if the server supports the FILEEXISTS command.
 boolean isQueryKeywordsSupported()
          Checks if the server supports the queryKeywords parameter on the executeQuery method.
 void logTo(java.lang.String account, java.lang.String password)
          Logs the connection to the requested account.
 java.lang.String mvCall(java.lang.String RuleParams)
          Executes the business rule set by setRuleName
 java.lang.String MVSPClientVersion()
          Returns the MVSP client version.
 MVSubroutine mvSub(java.lang.String subName)
          Creates a mvSub object.
 MVSubroutine mvSub(java.lang.String subName, int arguments)
          Creates a mvSub object.
 java.lang.String ping()
          Sends a command on the connection to assert liveliness.
 java.lang.String readFromServer(boolean all, boolean isConnecting)
          Read from server socket
 java.lang.String replace(java.lang.String dArray, int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Replaces a sub value in a dynamic array.
 java.lang.String replace(java.lang.String dArray, int attrNum, int valNum, java.lang.String value)
          Replaces a value in a dynamic array.
 java.lang.String replace(java.lang.String dArray, int attrNum, java.lang.String attribute)
          Replaces an attribute in a dynamic array.
 boolean reset()
          Resets the connection by closing the socket and reopening the connection.
 void setRuleModule(java.lang.String rule)
          Sets the rule name for subsequent mvCall
 java.lang.String swap(java.lang.String array, java.lang.String oldStr, java.lang.String newStr)
          Replace every occurrence of oldStr with newStr in array.
 boolean transactionBegin()
          Begins a transaction in the database.
 boolean transactionCommit()
          Commits a transaction in the database.
 boolean transactionRollback()
          Rolls back a transaction in the database.
 boolean transactionStatus()
          Gets the current database transaction status.
 void writeToServer(java.lang.String data)
          Writes data to the server.
 
Methods inherited from class com.rocketsoftware.mvapi.AbstractConnection
clearWarnings, commit, createArrayOf, createBlob, createClob, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap, unwrap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVConnection

public MVConnection()
Default constructor.


MVConnection

public MVConnection(java.lang.String url,
                    java.util.Properties props)
             throws MVException
Creates a connection object to the url with the provided properties.

Parameters:
url - url of the server.

The url must be in the following format:

jdbc:mv:vendor:host:port

where:

jdbc:mv identifies this connection as a Multivalue server connection

vendor Multivalue vendor name: D3, mvBase, U2.

host TCP/IP hostname or IP address

port TCP/IP port number

Note: the Telnet server must be configured and started to listen for connections on this port

Example url:

A connection to a D3 server at localhost and port 9000 would be specified as:

jdbc:mv:d3:localhost:9000

props - connection properties including username and password: example:

Properties props = new Properties();

props.setProperty("username", user);

props.setProperty("password", password);

Throws:
MVException

MVConnection

public MVConnection(java.lang.String host,
                    int port,
                    java.lang.String user,
                    java.lang.String pwd,
                    java.lang.String account,
                    boolean sslConnect,
                    boolean licEnterprise)
             throws MVException
Constructs a connection object using a host name, port number, user and password.

Parameters:
host - hostname to connect
port - port number
user - user name
pwd - user password
account - default account
sslConnect - true if using an SSL connection
licEnterprise - true if using Enterprise licensing

Note: if using Enterprise licensing, the path to d3iphelper.dll library must be provided at runtime in the java.library.path value, e.g. java -Djava.library.path="c:\d3client\libs\"

Throws:
MVException - if any errors occur

MVConnection

public MVConnection(java.lang.String host,
                    int port,
                    java.lang.String user,
                    java.lang.String pwd)
             throws MVException
Constructs a connection object using a host name, port number, user and password.

Parameters:
host - hostname to connect
port - port number
user - user name
pwd - user password
Throws:
MVException - if any errors occur

MVConnection

public MVConnection(java.lang.String host,
                    int port,
                    java.lang.String user,
                    java.lang.String pwd,
                    boolean sslConnect,
                    boolean licEnterprise)
             throws MVException
Constructs a connection object using a host name, port number, user and password.

Parameters:
host - hostname to connect
port - port number
user - user name
pwd - user password
sslConnect - true if using an SSL connection
licEnterprise - true if using Enterprise licensing

Note: if using Enterprise licensing, the path to d3iphelper.dll library must be provided at runtime in the java.library.path value, e.g. java -Djava.library.path="c:\d3client\libs\"

Throws:
MVException - if any errors occur

MVConnection

public MVConnection(java.lang.String host,
                    int port,
                    java.lang.String user,
                    java.lang.String pwd,
                    java.lang.String account,
                    boolean sslConnect,
                    MVConstants.LicenseType licenseType)
             throws MVException
Constructs a connection object using a host name, port number, user and password.

Parameters:
host - hostname to connect
port - port number
user - user name
pwd - user password
account - default account
sslConnect - true if using an SSL connection
licenseType - license type (User, Enterprise, or Connection Pool licensing)
Throws:
MVException - if any errors occur
Method Detail

connect

public boolean connect()
                throws MVException
Connects to the server.

Throws:
MVException - if connection error occurs.

getConnectionProperties

public java.lang.String getConnectionProperties()

isConnectionPooled

public boolean isConnectionPooled()
Determines if the connection is pooled.

Returns:
boolean true if the connection is pooled

reset

public boolean reset()
              throws MVException
Resets the connection by closing the socket and reopening the connection.

Returns:
true if successfull.
Throws:
MVException - if any errors occur when closing or reopening the connection.

close

public void close()
           throws MVException
Releases this Connection object's database resources

Specified by:
close in interface java.sql.Connection
Overrides:
close in class AbstractConnection
Throws:
MVException - if a database access error occurs

closeConnection

public void closeConnection()
                     throws MVException
Closes the connection.

Throws:
MVException

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               int subValNum,
                               java.lang.String subValue)
                        throws MVException
Inserts a sub value into a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value containing the sub value to insert
valNum - 1-relative Index of the value containing the sub value to insert
subValNum - 1-relative Index of the sub value to insert
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute inserted.
Throws:
MVException

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               java.lang.String value)
                        throws MVException
Inserts a value into a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value containing the subvalue to insert
valNum - 1-relative Index of the value containing the sub value to insert
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute inserted.
Throws:
MVException

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               java.lang.String attribute)
                        throws MVException
Inserts an attribute into a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - Index of the attribute to insert
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute inserted.
Throws:
MVException

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                int subValNum,
                                java.lang.String subValue)
                         throws MVException
Replaces a sub value in a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the sub value to replace
valNum - 1-relative index of the value containing the sub value to replace
subValNum - 1-relative index of the sub value to replace
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute replaced.
Throws:
MVException

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                java.lang.String value)
                         throws MVException
Replaces a value in a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
valNum - 1-relative index of the value containg the subvalue to replace
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute replaced.
Throws:
MVException

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                java.lang.String attribute)
                         throws MVException
Replaces an attribute in a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute replaced.
Throws:
MVException

isClosed

public boolean isClosed()
                 throws MVException
Specified by:
isClosed in interface java.sql.Connection
Overrides:
isClosed in class AbstractConnection
Throws:
MVException

createStatement

public MVStatement createStatement()
                            throws MVException
Creates a Statement object for sending AQL or TCL statements to the database.

Specified by:
createStatement in interface java.sql.Connection
Overrides:
createStatement in class AbstractConnection
Returns:
a new MVStatement object
Throws:
MVException - if a database access error occurs

isConnected

public boolean isConnected()
Checks current connection state.

Returns:
true if connection has been opened to the server

logTo

public void logTo(java.lang.String account,
                  java.lang.String password)
           throws MVException
Logs the connection to the requested account.

Parameters:
account - account name
password - account password
Throws:
MVException - if the logto command failed

getCurrentAccount

public java.lang.String getCurrentAccount()
                                   throws MVException
Gets the current logged to account.

Returns:
string of current logged to account
Throws:
MVException

getCurrentAccountPwd

public java.lang.String getCurrentAccountPwd()
                                      throws MVException
Gets the current logged to account password.

Returns:
string of current logged to account password
Throws:
MVException

clearSelect

public void clearSelect()
                 throws MVException
Clears an active select list.

Throws:
MVException - if errors occur

call

public java.lang.String call(java.lang.String name,
                             java.lang.String data)
                      throws MVException
Calls a mvSub.

The mvSub must be defined to take two arguments:

subname(indata, outdata)

The indata argument will receive the data parameter from this mvCall method. The mvSub must return its result in the outdata argument. The outdata argument will then be returned as the result from this method.

Parameters:
name - name of mvSub, may include fullpath if supported

for example: (read.item or dev,bp, read.item)

data - string data to pass in
Returns:
returned results
Throws:
MVException - if a mvSub mvCall error occurs

call

public java.lang.String call(java.lang.String name,
                             java.util.List<java.lang.String> arguments)
                      throws MVException
Calls a mvSub.

The mvSub must be defined to take two arguments:

subname(indata, outdata)

The indata argument will receive the data parameter from this mvCall method. The mvSub must return it's result in the outdata argument. The outdata argument will then be returned as the result from this method.

Parameters:
name - name of mvSub, may include fullpath if supported

for example: (read.item or dev,bp, read.item)

arguments - list of arguments to pass in
Returns:
returned results
Throws:
MVException - if a mvSub mvCall error occurs

execute

public void execute(java.lang.String command)
             throws MVException
Executes a command and populates the "capturing" and "returning" results.

Parameters:
command - command to execute
Throws:
MVException - raised if errors encountered

execute

public void execute(java.lang.String command,
                    java.lang.String data)
             throws MVException
Executes a command and populates the "capturing" and "returning" results.

Parameters:
command - command to execute
data - data to stack to the command
Throws:
MVException - if execute errors occur

getExecuteReturning

public java.lang.String getExecuteReturning()
                                     throws MVException
Returns the returning result of an execute statement (execute command returning result).

Returns:
string containing the execute 'returning' data
Throws:
MVException - if any execute or connection errors occur

getExecuteCapturing

public java.lang.String getExecuteCapturing()
                                     throws MVException
Returns the captured result of an execute statement (execute command capturing result).

Returns:
string containing the execute 'caputuring' data
Throws:
MVException - if any execute or connection errors occur

executeQuery

public MVResultSet executeQuery(java.lang.String query)
                         throws MVException
Queries the MV database.

Parameters:
query - - e.g. SORT EMPLOYEES BY LASTNAME LASTNAME FIRSTNAME
Returns:
MVResultSet query results
Throws:
MVException - if any errors encountered

getConnector

public MVConnector getConnector()
Returns the connector object.

Returns:
MVConnector object

getServerVersion

public java.lang.String getServerVersion()
Gets the MVSP version.

Returns:
MVSP Version

setRuleModule

public void setRuleModule(java.lang.String rule)
                   throws MVException
Sets the rule name for subsequent mvCall

Parameters:
rule - (cataloged mvSub) name
Throws:
MVException

getRuleModule

public java.lang.String getRuleModule()
                               throws MVException
Gets the rulename you had set via setRuleName

Returns:
rule name
Throws:
MVException

mvCall

public java.lang.String mvCall(java.lang.String RuleParams)
                        throws MVException
Executes the business rule set by setRuleName

Parameters:
RuleParams - x'fe' delimited list of parameters
Returns:
NetEvents array + char(24) + NetProperties array + char(254) + business rule output
Throws:
MVException - if a mvSub mvCall error occurs

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum)
                         throws MVException
Dynamic array reference

Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
Returns:
the attrNumth attribute
Throws:
MVException

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum,
                                int valNum)
                         throws MVException
Dynamic array reference

Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
valNum - - Value number (1-relative)
Returns:
valNumth value of the attrNumth attribute
Throws:
MVException

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                int subValNum)
                         throws MVException
Dynamic array references

Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
valNum - - Value number (1-relative)
subValNum - - subvalue number (1-relative)
Returns:
subValNumthe subvalue of the valNumth value of the attrNumth attribute
Throws:
MVException

field

public java.lang.String field(java.lang.String dArray,
                              java.lang.String delim,
                              int pos)
                       throws MVException
Extracts a substring from the dynamic array.

Parameters:
dArray - Dynamic array
delim - - delimiter to use
pos - - occurrance number
Returns:
subValNumthe subvalue of the valNumth value of the attrNumth attribute
Throws:
MVException

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum)
                        throws MVException
Delete attribute from dynamic array

Parameters:
dArray - Dynamic array
attrNum - 1-relative attribute number to delete
Returns:
dynamic array with the specified attribute deleted. e.g. delete("a^b^c",2) returns "a^c", where "^" is char(254).
Throws:
MVException

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum,
                               int valNum)
                        throws MVException
Deletes a value from the dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value
valNum - 1-relative Index of the value to delete
Returns:
dynamic array with the specified value in the specified attribute deleted. e.g. delete("a^b]1^c",2,1) returns "a^1^c", where "^" is char(254) and "]" is char(253).
Throws:
MVException

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               int subValNum)
                        throws MVException
Deletes a sub value from a dynamic array.

Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value containing the sub value to delete
valNum - 1-relative Index of the value containing the sub value to delete
subValNum - 1-relative Index of the sub value to delete
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute deleted. e.g. delete("a^b]1\2\3^c",2,2,1) returns "a^b]2\3^c", where "^" is char(254), "]" is char(253), and "\" is char(252).
Throws:
MVException

count

public int count(java.lang.String stringToSearch,
                 char charToCount)
          throws MVException
Counts character occurances in another string.

Parameters:
stringToSearch -
charToCount -
Returns:
number of charToCount characters in stringToSearch
Throws:
MVException

dCount

public int dCount(java.lang.String dArray,
                  char delim)
           throws MVException
This function returns how many elements of the type indicated by delim are contained in the given dynamic array. For example:
dCount("A" + MVConstants.AM + "B", MVConstants.AM)
returns 2, since it contains 2 attributes, "A" and "B", and AM (Attribute Mark) is the delimiter for attributes.

Parameters:
dArray - dynamic array to search
delim - delimiter to count
Returns:
Number of delimiters plus one, unless dArray is a null string, in which case zero is returned
Throws:
MVException

swap

public java.lang.String swap(java.lang.String array,
                             java.lang.String oldStr,
                             java.lang.String newStr)
                      throws MVException
Replace every occurrence of oldStr with newStr in array.

Parameters:
array - - a string containing zero or more occurrences of oldStr.
oldStr - - the string to search for in array.
newStr - - the string with which to replace every occurrence of oldStr in array.
Returns:
- a new string containing newStr where any oldStr used to be.
Throws:
MVException

getFileStatusCode

public int getFileStatusCode()
                      throws MVException
Returns:
Result code of most recent file operation
Throws:
MVException

getEol

public boolean getEol()
               throws MVException
Checks for end of list, i.e., will READNEXT fail.

Returns:
true if end of list
Throws:
MVException

getFileStatusMessage

public java.lang.String getFileStatusMessage()
                                      throws MVException
If getFileStatusCode returns non-zero, mvCall this to get a textual error message.

Returns:
Error message text of the most recent file operation failure
Throws:
MVException

fileCacheRelease

public boolean fileCacheRelease(java.lang.String path)
                         throws MVException
Releases the associated file cache entry for the specified opened file on the MVSP server.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
true if successful
Throws:
MVException

fileRead

public java.lang.String fileRead(java.lang.String path,
                                 java.lang.String itemId)
                          throws MVException
Reads an item from the file.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
Item body
Throws:
MVException

fileReadU

public java.lang.String fileReadU(java.lang.String path,
                                  java.lang.String itemId)
                           throws MVException
Reads an item from the file, setting an itemlock.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
Item body if lock successful, otherwise a null string, and getFileStatusCode returns -1.
Throws:
MVException

fileReadV

public java.lang.String fileReadV(java.lang.String path,
                                  java.lang.String itemId,
                                  int attribute)
                           throws MVException
Reads an item's attribute value from the file.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
Item body if lock successful, otherwise a null string, and getFileStatusCode returns -1.
Throws:
MVException

fileReadVU

public java.lang.String fileReadVU(java.lang.String path,
                                   java.lang.String itemId,
                                   int attribute)
                            throws MVException
Reads an item's attribute value from the file, setting an item lock.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
Item body if lock successful, otherwise a null string, and getFileStatusCode returns -1.
Throws:
MVException

fileDelete

public java.lang.String fileDelete(java.lang.String path,
                                   java.lang.String itemId)
                            throws MVException
Deletes an item from the file.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
null string
Throws:
MVException

fileRelease

public java.lang.String fileRelease(java.lang.String path,
                                    java.lang.String itemId)
                             throws MVException
Releases an item lock set by a prior fileReadU.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
null string
Throws:
MVException - exception raised if any errors encountered

fileWrite

public java.lang.String fileWrite(java.lang.String path,
                                  java.lang.String itemId,
                                  java.lang.String itemBody)
                           throws MVException
Writes an item to the file, releasing the update lock set by a previous fileReadU of the same item.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
itemBody - item contents
Returns:
null string
Throws:
MVException - exception raised if any errors encountered

fileWriteU

public java.lang.String fileWriteU(java.lang.String path,
                                   java.lang.String itemId,
                                   java.lang.String itemBody)
                            throws MVException
Writes an item to the file, keeping update lock set by a previous fileReadU of the same item.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
itemBody - item contents
Returns:
null string
Throws:
MVException - exception raised if any errors encountered

fileWriteV

public java.lang.String fileWriteV(java.lang.String path,
                                   java.lang.String itemId,
                                   java.lang.String attributeValue,
                                   int attribute)
                            throws MVException
Writes a value to an item's attribute.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attribute - The attribute number to read
attributeValue - The value to write
Returns:
null string
Throws:
MVException - exception raised if any errors encountered

fileWriteVU

public java.lang.String fileWriteVU(java.lang.String path,
                                    java.lang.String itemId,
                                    java.lang.String attributeValue,
                                    int attribute)
                             throws MVException
Writes a value to an item's attribute, keeping update lock set by a previous fileReadU/fileReadVU of the same item.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attributeValue - The value to write
attribute - The attribute number to read
Returns:
null string
Throws:
MVException - exception raised if any errors encountered

fileSelect

public boolean fileSelect(java.lang.String path)
                   throws MVException
Selects the file specified by path for a subsequent fileReadNext.

Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
true if success, otherwise false, in which case you need to mvCall getFileStatusMessage() to see what went wrong.
Throws:
MVException - exception raised if any errors encountered

fileReadNext

public java.lang.String fileReadNext()
                              throws MVException
Gets the next item ID from the current fileSELECT list.

Returns:
item ID or null string if end of list. Since null item-ids are permissible, mvCall fileOpOK(), which will return 1 if End of List.
Throws:
MVException

getServerPort

public java.lang.String getServerPort()
                               throws MVException
Gets the server connect information (port number on D3/MV).

Returns:
string representing the server port.
Throws:
MVException

getServerEnvironment

public java.lang.String getServerEnvironment()
                                      throws MVException
Gets the server's environment setting.

Returns:
server environment
Throws:
MVException

getServerPlatform

public java.lang.String getServerPlatform()
                                   throws MVException
Gets the server's platform name.

Returns:
server environment
Throws:
MVException

ping

public java.lang.String ping()
                      throws MVException
Sends a command on the connection to assert liveliness.

Returns:
result of the command.
Throws:
MVException - if connection is not usable.

mvSub

public MVSubroutine mvSub(java.lang.String subName,
                          int arguments)
Creates a mvSub object.

Parameters:
subName - name of the mvSub
arguments - number of arguments
Returns:
mvSub object

mvSub

public MVSubroutine mvSub(java.lang.String subName)
Creates a mvSub object.

Parameters:
subName - name of the mvSub
Returns:
mvSub object

isFileExistCmdSupported

public boolean isFileExistCmdSupported()
                                throws MVException
Checks if the server supports the FILEEXISTS command.

Returns:
true if command is supported
Throws:
MVException

isQueryKeywordsSupported

public boolean isQueryKeywordsSupported()
                                 throws MVException
Checks if the server supports the queryKeywords parameter on the executeQuery method.

Returns:
true if command is supported
Throws:
MVException

MVSPClientVersion

public java.lang.String MVSPClientVersion()
                                   throws MVException
Returns the MVSP client version.

Returns:
MVSP client version
Throws:
MVException

transactionBegin

public boolean transactionBegin()
                         throws MVException
Begins a transaction in the database.

Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

transactionCommit

public boolean transactionCommit()
                          throws MVException
Commits a transaction in the database.

Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

transactionRollback

public boolean transactionRollback()
                            throws MVException
Rolls back a transaction in the database.

Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

transactionStatus

public boolean transactionStatus()
                          throws MVException
Gets the current database transaction status.

Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

readFromServer

public java.lang.String readFromServer(boolean all,
                                       boolean isConnecting)
                                throws MVException
Read from server socket

Parameters:
all - read all available bytes. false means read only to end of current message
isConnecting - true if called during logon process
Returns:
data read from server
Throws:
MVException - raised if any errors encountered

writeToServer

public void writeToServer(java.lang.String data)
                   throws java.io.IOException
Writes data to the server.

Parameters:
data - to write
Throws:
java.io.IOException

isConnectionPoolingSupported

public final boolean isConnectionPoolingSupported()