com.ibm.jtopenlite.database
Class DatabaseConnection
- java.lang.Object
-
- com.ibm.jtopenlite.HostServerConnection
-
- com.ibm.jtopenlite.database.DatabaseConnection
-
- All Implemented Interfaces:
- Connection
public class DatabaseConnection extends HostServerConnection
Represents a TCP/IP socket connection to the System i Database host server (QUSRWRK/QZDASOINIT job).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.jtopenlite.HostServerConnection
HostServerConnection.HostInputStream, HostServerConnection.HostOutputStream
-
-
Field Summary
Fields Modifier and Type Field and Description static int
DATA_FORMAT
static int
DATA_SOURCE_INFORMATION
static int
DEFAULT_DATABASE_SERVER_PORT
static int
DEFAULT_SSL_DATABASE_SERVER_PORT
static int
EXTENDED_COLUMN_DESCRIPTORS
static int
FIRST_LEVEL_TEXT
static int
MESSAGE_ID
static int
PACKAGE_INFORMATION
static int
PARAMETER_MARKER_FORMAT
static int
REPLY_RLE_COMPRESSED
static int
REPLY_VARLEN_COLUMN_COMPRESSED
static int
REQUST_RLE_COMPRESSED
static int
RESULT_DATA
static int
RETURN_RESULT_SET_ATTRIBUTES
static int
SECOND_LEVEL_TEXT
static int
SEND_REPLY_IMMED
static int
SERVER_ATTRIBUTES
static int
SQLCA
static int
TRANSLATION_TABLES
-
Fields inherited from class com.ibm.jtopenlite.HostServerConnection
in_, out_
-
-
Method Summary
-
Methods inherited from class com.ibm.jtopenlite.HostServerConnection
close, connect, finalize, getBytesReceived, getBytesSent, getEncryptedPassword, getInfo, getJobName, getUser, isClosed, isDatastreamDebug, isDefaultDatastreamDebug, setDatastreamDebug, setDefaultDatastreamDebug, writePadEBCDIC, writePadEBCDIC10, writeStringToUnicodeBytes
-
-
-
-
Field Detail
-
DEFAULT_DATABASE_SERVER_PORT
public static final int DEFAULT_DATABASE_SERVER_PORT
- See Also:
- Constant Field Values
-
DEFAULT_SSL_DATABASE_SERVER_PORT
public static final int DEFAULT_SSL_DATABASE_SERVER_PORT
- See Also:
- Constant Field Values
-
SEND_REPLY_IMMED
public static final int SEND_REPLY_IMMED
- See Also:
- Constant Field Values
-
MESSAGE_ID
public static final int MESSAGE_ID
- See Also:
- Constant Field Values
-
FIRST_LEVEL_TEXT
public static final int FIRST_LEVEL_TEXT
- See Also:
- Constant Field Values
-
SECOND_LEVEL_TEXT
public static final int SECOND_LEVEL_TEXT
- See Also:
- Constant Field Values
-
DATA_FORMAT
public static final int DATA_FORMAT
- See Also:
- Constant Field Values
-
RESULT_DATA
public static final int RESULT_DATA
- See Also:
- Constant Field Values
-
SQLCA
public static final int SQLCA
- See Also:
- Constant Field Values
-
SERVER_ATTRIBUTES
public static final int SERVER_ATTRIBUTES
- See Also:
- Constant Field Values
-
PARAMETER_MARKER_FORMAT
public static final int PARAMETER_MARKER_FORMAT
- See Also:
- Constant Field Values
-
TRANSLATION_TABLES
public static final int TRANSLATION_TABLES
- See Also:
- Constant Field Values
-
DATA_SOURCE_INFORMATION
public static final int DATA_SOURCE_INFORMATION
- See Also:
- Constant Field Values
-
PACKAGE_INFORMATION
public static final int PACKAGE_INFORMATION
- See Also:
- Constant Field Values
-
REQUST_RLE_COMPRESSED
public static final int REQUST_RLE_COMPRESSED
- See Also:
- Constant Field Values
-
REPLY_RLE_COMPRESSED
public static final int REPLY_RLE_COMPRESSED
- See Also:
- Constant Field Values
-
EXTENDED_COLUMN_DESCRIPTORS
public static final int EXTENDED_COLUMN_DESCRIPTORS
- See Also:
- Constant Field Values
-
REPLY_VARLEN_COLUMN_COMPRESSED
public static final int REPLY_VARLEN_COLUMN_COMPRESSED
- See Also:
- Constant Field Values
-
RETURN_RESULT_SET_ATTRIBUTES
public static final int RETURN_RESULT_SET_ATTRIBUTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
isMessageInfoReturned
public boolean isMessageInfoReturned()
Indicates if the MESSAGE_ID, FIRST_LEVEL_TEXT, and SECOND_LEVEL_TEXT bits are set on the operational result bitmap for a database request.
-
setMessageInfoReturned
public void setMessageInfoReturned(boolean b)
-
setDebug
public void setDebug(boolean b)
-
setWarningCallback
public void setWarningCallback(DatabaseWarningCallback warningCallback)
-
setSQLCommunicationsAreaCallback
public void setSQLCommunicationsAreaCallback(DatabaseSQLCommunicationsAreaCallback callback)
-
sendEndJobRequest
protected void sendEndJobRequest() throws java.io.IOException
- Specified by:
sendEndJobRequest
in classHostServerConnection
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(java.lang.String system, java.lang.String user, java.lang.String password) throws java.io.IOException
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(boolean isSSL, java.lang.String system, java.lang.String user, java.lang.String password) throws java.io.IOException
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(SystemInfo info, java.lang.String user, java.lang.String password) throws java.io.IOException
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(boolean isSSL, SystemInfo info, java.lang.String user, java.lang.String password) throws java.io.IOException
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(SystemInfo info, java.lang.String user, java.lang.String password, int databasePort) throws java.io.IOException
- Throws:
java.io.IOException
-
getConnection
public static DatabaseConnection getConnection(boolean isSSL, SystemInfo info, java.lang.String user, java.lang.String password, int databasePort) throws java.io.IOException
- Throws:
java.io.IOException
-
getCurrentRequestParameterBlockID
public int getCurrentRequestParameterBlockID()
-
setCurrentRequestParameterBlockID
public void setCurrentRequestParameterBlockID(int rpbID)
Sets the current RPB handle to use for all actions, excluding those that accept an rpbID as a parameter.
-
createRequestParameterBlock
public void createRequestParameterBlock(DatabaseCreateRequestParameterBlockAttributes attribs, int rpbID) throws java.io.IOException
Sends a request to create an RPB and sets the current RPB ID to be the one specified.- Throws:
java.io.IOException
-
deleteRequestParameterBlock
public void deleteRequestParameterBlock(DatabaseDeleteRequestParameterBlockAttributes attribs, int rpbID) throws java.io.IOException
- Throws:
java.io.IOException
-
resetRequestParameterBlock
public void resetRequestParameterBlock(DatabaseCreateRequestParameterBlockAttributes attribs, int rpbID) throws java.io.IOException
Sends a request to reset an RPB and sets the current RPB ID to be the one specified.- Throws:
java.io.IOException
-
prepare
public void prepare(DatabasePrepareAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
prepareAndDescribe
public void prepareAndDescribe(DatabasePrepareAndDescribeAttributes attribs, DatabaseDescribeCallback listener, DatabaseParameterMarkerCallback pmListener) throws java.io.IOException
- Throws:
java.io.IOException
-
prepareAndExecute
public void prepareAndExecute(DatabasePrepareAndExecuteAttributes attribs, DatabaseDescribeCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
openAndDescribe
public void openAndDescribe(DatabaseOpenAndDescribeAttributes attribs, DatabaseDescribeCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
openAndDescribe
public void openAndDescribe(DatabaseOpenAndDescribeAttributes attribs, int parameterMarkerDescriptorHandle, DatabaseDescribeCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
openDescribeFetch
public void openDescribeFetch(DatabaseOpenDescribeFetchAttributes attribs, DatabaseDescribeCallback describeListener, DatabaseFetchCallback fetchListener) throws java.io.IOException
- Throws:
java.io.IOException
-
createPackage
public void createPackage(DatabasePackageAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
deletePackage
public void deletePackage(DatabasePackageAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
retrievePackage
public void retrievePackage(DatabaseRetrievePackageAttributes attribs, DatabasePackageCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
describeParameterMarker
public void describeParameterMarker(DatabaseDescribeParameterMarkerAttributes attribs, DatabaseParameterMarkerCallback callback) throws java.io.IOException
- Throws:
java.io.IOException
-
changeDescriptor
public void changeDescriptor(DatabaseChangeDescriptorAttributes attribs, int descriptorHandle) throws java.io.IOException
- Throws:
java.io.IOException
-
deleteDescriptor
public void deleteDescriptor(DatabaseDeleteDescriptorAttributes attribs, int descriptorHandle) throws java.io.IOException
- Throws:
java.io.IOException
-
describe
public void describe(DatabaseDescribeAttributes attribs, DatabaseDescribeCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
fetch
public void fetch(DatabaseFetchAttributes attribs, DatabaseFetchCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
streamFetch
public void streamFetch(DatabaseStreamFetchAttributes attribs, DatabaseFetchCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
endStreamFetch
public void endStreamFetch(DatabaseEndStreamFetchAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
executeImmediate
public void executeImmediate(DatabaseExecuteImmediateAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public void execute(DatabaseExecuteAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public void execute(DatabaseExecuteAttributes attribs, int parameterMarkerDescriptorHandle) throws java.io.IOException
- Throws:
java.io.IOException
-
executeOrOpenAndDescribe
public void executeOrOpenAndDescribe(DatabaseExecuteOrOpenAndDescribeAttributes attrib, DatabaseDescribeCallback listener) throws java.io.IOException
- Throws:
java.io.IOException
-
closeCursor
public void closeCursor(DatabaseCloseCursorAttributes attribs) throws java.io.IOException
- Throws:
java.io.IOException
-
commit
public void commit() throws java.io.IOException
- Throws:
java.io.IOException
-
rollback
public void rollback() throws java.io.IOException
- Throws:
java.io.IOException
-
setServerAttributes
public void setServerAttributes(DatabaseServerAttributes attributes) throws java.io.IOException
- Throws:
java.io.IOException
-
retrieveLOBData
public void retrieveLOBData(DatabaseRetrieveLOBDataAttributes attribs, DatabaseLOBDataCallback lobCallback) throws java.io.IOException
- Throws:
java.io.IOException
-
-