|
IBM DB2 Information Integrator Java API Reference for Developing Wrappers |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.db2.wrapper.SqlqgBaseClass
com.ibm.db2.wrapper.RemoteConnection
The RemoteConnection class represents a connection (session) with a data source server. The operations on the data source server (database) are processed through a connection. Connections can be created only for untrusted and fenced data source servers. The RemoteConnection base class implementation maintains the following information:
FencedServer
object.
FencedRemoteUser
object.
ONE_PHASE_KIND
value, or not, the NO_PHASE_KIND
value.
Usage:
You can create an instance of your RemoteConnection subclass by invoking the
FencedServer.createRemoteConnection
method on an instance of the appropriate
fenced server subclass. The federated server calls this method before processing
the first remote operation at the relevant data source server. The federated
server destroys the RemoteConnection instance after a predefined number of
transactions are processed by the application without using the data source
server.
Field Summary | |
static int |
NO_PHASE_KIND
Constant to indicate that no transactions are supported. |
static int |
ONE_PHASE_KIND
Constant to indicate that one-phase commit transactions are supported. |
Constructor Summary | |
protected |
RemoteConnection(FencedServer remoteServer,
FencedRemoteUser remoteUser,
int connectionKind,
long id)
Construct a connection for the specified server with the user authorization and transaction type as specified. |
Method Summary | |
protected void |
commit()
Indicate the successful completion of a transaction and that the remote data source then commits the transaction. |
protected void |
connect()
Invoke the code to connect to the data source server. |
protected RemotePassthru |
createRemotePassthru(long id)
Create a RemotePassthru object to run pass-through statements. |
protected RemoteQuery |
createRemoteQuery(long id)
Create a RemoteQuery object to run SQL statements. |
protected void |
disconnect()
Invoke the code to disconnect from the data source server. |
short |
getCodepage()
Retrieve the code page for the connection. |
int |
getKind()
Retrieve the connection type. |
FencedServer |
getServer()
Retrieve the data source server object that contains this connection. |
FencedRemoteUser |
getUser()
Retrieve the user mapping to authenticate this connection. |
Wrapper |
getWrapper()
Retrieve the wrapper object. |
boolean |
isConnected()
Verify whether the connection with the data source server exists. |
void |
markDisconnected()
Set the flag to indicate that the connection with the data source server finished. |
protected void |
rollback()
Indicate the unsuccessful completion of a transaction and that the remote data source then rolls back the transaction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_PHASE_KIND
public static final int ONE_PHASE_KIND
Constructor Detail |
protected RemoteConnection(FencedServer remoteServer, FencedRemoteUser remoteUser, int connectionKind, long id)
remoteServer
- The data source server that contains the connection.remoteUser
- The user mapping object that is used for authentication.connectionKind
- The type of connection, specifies the supported transaction types.
A connection that can support one-phase commit transactions is
indicated by the ONE_PHASE_KIND
constant. A connection
that does not have transaction support is indicated by the NO_PHASE_KIND
constant.id
- An integer value that represents the RemoteConnection object.FencedServer
,
FencedRemoteUser
Method Detail |
protected void commit() throws java.lang.Exception
java.lang.Exception
- if the method fails.protected void connect() throws java.lang.Exception
java.lang.Exception
- if the method fails.protected RemotePassthru createRemotePassthru(long id) throws java.lang.Exception
id
- An integer value that represents the RemotePassthru object.
java.lang.Exception
- if the object creation fails.RemotePassthru
protected RemoteQuery createRemoteQuery(long id) throws java.lang.Exception
id
- An integer value that represents the RemoteQuery object.
java.lang.Exception
- if the object creation fails.RemoteQuery
protected void disconnect() throws java.lang.Exception
java.lang.Exception
- if the method fails.public final short getCodepage()
public final int getKind()
ONE_PHASE_KIND
constant) or
cannot support transactions (indicated by the
NO_PHASE_KIND
constant).
public final FencedServer getServer()
FencedServer
public final FencedRemoteUser getUser()
FencedRemoteUser
public final Wrapper getWrapper()
Wrapper
public final boolean isConnected()
public final void markDisconnected()
protected void rollback() throws java.lang.Exception
java.lang.Exception
- if the method fails.
|
IBM DB2 Information Integrator Java API Reference for Developing Wrappers |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(C)Copyright IBM Corp. 2002. All rights reserved.
Links on this page are made available for your convenience and may take you to non-IBM sites. IBM does not warrant any sample code provided on these sites.