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).
|
Method Summary |
void |
changeDescriptor(DatabaseChangeDescriptorAttributes attribs,
int descriptorHandle)
|
void |
closeCursor(DatabaseCloseCursorAttributes attribs)
|
void |
commit()
|
void |
createPackage(DatabasePackageAttributes attribs)
|
void |
createRequestParameterBlock(DatabaseCreateRequestParameterBlockAttributes attribs,
int rpbID)
Sends a request to create an RPB and sets the current RPB ID to be the one specified. |
void |
deleteDescriptor(DatabaseDeleteDescriptorAttributes attribs,
int descriptorHandle)
|
void |
deletePackage(DatabasePackageAttributes attribs)
|
void |
deleteRequestParameterBlock(DatabaseDeleteRequestParameterBlockAttributes attribs,
int rpbID)
|
void |
describe(DatabaseDescribeAttributes attribs,
DatabaseDescribeCallback listener)
|
void |
describeParameterMarker(DatabaseDescribeParameterMarkerAttributes attribs,
DatabaseParameterMarkerCallback callback)
|
void |
endStreamFetch(DatabaseEndStreamFetchAttributes attribs)
|
void |
execute(DatabaseExecuteAttributes attribs)
|
void |
execute(DatabaseExecuteAttributes attribs,
int parameterMarkerDescriptorHandle)
|
void |
executeImmediate(DatabaseExecuteImmediateAttributes attribs)
|
void |
executeOrOpenAndDescribe(DatabaseExecuteOrOpenAndDescribeAttributes attrib,
DatabaseDescribeCallback listener)
|
void |
fetch(DatabaseFetchAttributes attribs,
DatabaseFetchCallback listener)
|
static DatabaseConnection |
getConnection(String system,
String user,
String password)
|
static DatabaseConnection |
getConnection(SystemInfo info,
String user,
String password)
|
static DatabaseConnection |
getConnection(SystemInfo info,
String user,
String password,
int databasePort)
|
int |
getCurrentRequestParameterBlockID()
|
void |
openAndDescribe(DatabaseOpenAndDescribeAttributes attribs,
DatabaseDescribeCallback listener)
|
void |
openAndDescribe(DatabaseOpenAndDescribeAttributes attribs,
int parameterMarkerDescriptorHandle,
DatabaseDescribeCallback listener)
|
void |
openDescribeFetch(DatabaseOpenDescribeFetchAttributes attribs,
DatabaseDescribeCallback describeListener,
DatabaseFetchCallback fetchListener)
|
void |
prepare(DatabasePrepareAttributes attribs)
|
void |
prepareAndDescribe(DatabasePrepareAndDescribeAttributes attribs,
DatabaseDescribeCallback listener,
DatabaseParameterMarkerCallback pmListener)
|
void |
prepareAndExecute(DatabasePrepareAndExecuteAttributes attribs,
DatabaseDescribeCallback listener)
|
void |
resetRequestParameterBlock(DatabaseCreateRequestParameterBlockAttributes attribs,
int rpbID)
Sends a request to reset an RPB and sets the current RPB ID to be the one specified. |
void |
retrieveLOBData(DatabaseRetrieveLOBDataAttributes attribs,
DatabaseLOBDataCallback lobCallback)
|
void |
retrievePackage(DatabaseRetrievePackageAttributes attribs,
DatabasePackageCallback listener)
|
void |
rollback()
|
protected void |
sendEndJobRequest()
|
void |
setCurrentRequestParameterBlockID(int rpbID)
Sets the current RPB handle to use for all actions, excluding those that accept an rpbID as a parameter. |
void |
setDebug(boolean b)
|
void |
setServerAttributes(DatabaseServerAttributes attributes)
|
void |
setSQLCommunicationsAreaCallback(DatabaseSQLCommunicationsAreaCallback callback)
|
void |
setWarningCallback(DatabaseWarningCallback warningCallback)
|
void |
streamFetch(DatabaseStreamFetchAttributes attribs,
DatabaseFetchCallback listener)
|
| Methods inherited from class com.ibm.jtopenlite.HostServerConnection |
close, connect, finalize, getEncryptedPassword, getInfo, getJobName, getUser, isClosed, isDatastreamDebug, isDefaultDatastreamDebug, setDatastreamDebug, writePadEBCDIC, writePadEBCDIC10, writeStringToUnicodeBytes |
DEFAULT_DATABASE_SERVER_PORT
public static final int DEFAULT_DATABASE_SERVER_PORT
- See Also:
- Constant Field Values
setDebug
public void setDebug(boolean b)
setWarningCallback
public void setWarningCallback(DatabaseWarningCallback warningCallback)
setSQLCommunicationsAreaCallback
public void setSQLCommunicationsAreaCallback(DatabaseSQLCommunicationsAreaCallback callback)
sendEndJobRequest
protected void sendEndJobRequest()
throws IOException
- Specified by:
sendEndJobRequest in class HostServerConnection
- Throws:
IOException
getConnection
public static DatabaseConnection getConnection(String system,
String user,
String password)
throws IOException
- Throws:
IOException
getConnection
public static DatabaseConnection getConnection(SystemInfo info,
String user,
String password)
throws IOException
- Throws:
IOException
getConnection
public static DatabaseConnection getConnection(SystemInfo info,
String user,
String password,
int databasePort)
throws IOException
- Throws:
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 IOException
- Sends a request to create an RPB and sets the current RPB ID to be the one specified.
- Throws:
IOException
deleteRequestParameterBlock
public void deleteRequestParameterBlock(DatabaseDeleteRequestParameterBlockAttributes attribs,
int rpbID)
throws IOException
- Throws:
IOException
resetRequestParameterBlock
public void resetRequestParameterBlock(DatabaseCreateRequestParameterBlockAttributes attribs,
int rpbID)
throws IOException
- Sends a request to reset an RPB and sets the current RPB ID to be the one specified.
- Throws:
IOException
prepare
public void prepare(DatabasePrepareAttributes attribs)
throws IOException
- Throws:
IOException
prepareAndDescribe
public void prepareAndDescribe(DatabasePrepareAndDescribeAttributes attribs,
DatabaseDescribeCallback listener,
DatabaseParameterMarkerCallback pmListener)
throws IOException
- Throws:
IOException
prepareAndExecute
public void prepareAndExecute(DatabasePrepareAndExecuteAttributes attribs,
DatabaseDescribeCallback listener)
throws IOException
- Throws:
IOException
openAndDescribe
public void openAndDescribe(DatabaseOpenAndDescribeAttributes attribs,
DatabaseDescribeCallback listener)
throws IOException
- Throws:
IOException
openAndDescribe
public void openAndDescribe(DatabaseOpenAndDescribeAttributes attribs,
int parameterMarkerDescriptorHandle,
DatabaseDescribeCallback listener)
throws IOException
- Throws:
IOException
openDescribeFetch
public void openDescribeFetch(DatabaseOpenDescribeFetchAttributes attribs,
DatabaseDescribeCallback describeListener,
DatabaseFetchCallback fetchListener)
throws IOException
- Throws:
IOException
createPackage
public void createPackage(DatabasePackageAttributes attribs)
throws IOException
- Throws:
IOException
deletePackage
public void deletePackage(DatabasePackageAttributes attribs)
throws IOException
- Throws:
IOException
retrievePackage
public void retrievePackage(DatabaseRetrievePackageAttributes attribs,
DatabasePackageCallback listener)
throws IOException
- Throws:
IOException
describeParameterMarker
public void describeParameterMarker(DatabaseDescribeParameterMarkerAttributes attribs,
DatabaseParameterMarkerCallback callback)
throws IOException
- Throws:
IOException
changeDescriptor
public void changeDescriptor(DatabaseChangeDescriptorAttributes attribs,
int descriptorHandle)
throws IOException
- Throws:
IOException
deleteDescriptor
public void deleteDescriptor(DatabaseDeleteDescriptorAttributes attribs,
int descriptorHandle)
throws IOException
- Throws:
IOException
describe
public void describe(DatabaseDescribeAttributes attribs,
DatabaseDescribeCallback listener)
throws IOException
- Throws:
IOException
fetch
public void fetch(DatabaseFetchAttributes attribs,
DatabaseFetchCallback listener)
throws IOException
- Throws:
IOException
streamFetch
public void streamFetch(DatabaseStreamFetchAttributes attribs,
DatabaseFetchCallback listener)
throws IOException
- Throws:
IOException
endStreamFetch
public void endStreamFetch(DatabaseEndStreamFetchAttributes attribs)
throws IOException
- Throws:
IOException
executeImmediate
public void executeImmediate(DatabaseExecuteImmediateAttributes attribs)
throws IOException
- Throws:
IOException
execute
public void execute(DatabaseExecuteAttributes attribs)
throws IOException
- Throws:
IOException
execute
public void execute(DatabaseExecuteAttributes attribs,
int parameterMarkerDescriptorHandle)
throws IOException
- Throws:
IOException
executeOrOpenAndDescribe
public void executeOrOpenAndDescribe(DatabaseExecuteOrOpenAndDescribeAttributes attrib,
DatabaseDescribeCallback listener)
throws IOException
- Throws:
IOException
closeCursor
public void closeCursor(DatabaseCloseCursorAttributes attribs)
throws IOException
- Throws:
IOException
commit
public void commit()
throws IOException
- Throws:
IOException
rollback
public void rollback()
throws IOException
- Throws:
IOException
setServerAttributes
public void setServerAttributes(DatabaseServerAttributes attributes)
throws IOException
- Throws:
IOException
retrieveLOBData
public void retrieveLOBData(DatabaseRetrieveLOBDataAttributes attribs,
DatabaseLOBDataCallback lobCallback)
throws IOException
- Throws:
IOException