To use ADO Events in ADO/WFC
public void onConnectComplete(Object sender,ConnectionEvent e)
{
System.out.println("onConnectComplete:" + e);
}
ConnectionEventHandler handler =
new ConnectionEventHandler(this, "onConnectComplete");
The first argument of the ConnectionEventHandler constructor is a reference to the class that contains the method named in the second argument.
The Microsoft Visual J++ compiler also supports an equivalent syntax:
ConnectionEventHandler handler =
new ConnectionEventHandler(this.onConnectComplete);
The single argument is a reference to the desired class (that is, this) and method within the class (that is, onConnectComplete).
The ADO/WFC event handler passes ADO ConnectionEvent parameters in an instance of the ADO/WFC ConnectionEvent class, or ADO RecordsetEvent parameters in an instance of the ADO/WFC RecordsetEvent class. These ADO/WFC classes consolidate the ADO event parameters; that is, each ADO/WFC class contains one data member for each unique parameter in all the ADO ConnectionEvent or RecordsetEvent methods.
public void onConnectComplete(Object sender,ConnectionEvent e)
The first argument is the type of object that sent the event (Connection or Recordset), and the second argument is the ADO/WFC event object (ConnectionEvent or RecordsetEvent).
The signature of your event handler is simpler than an ADO event. However, you must still understand the ADO Event model to know what parameters apply to an event and how to respond.