All Packages    This Package  Previous  Next  

Class sqlj.runtime.profile.ref.ProfileWrapper

java.lang.Object
   |
   +----sqlj.runtime.profile.ref.ProfileWrapper

public class ProfileWrapper
extends Object
implements ConnectedProfile
This class is the superclass of all classes that augment the functionality of connected profiles. These connected profiles sit on top of (wrap) an already existing connected profile (the underlying connected profile), but provide additional functionality.

The class ProfileWrapper itself overrides all methods of ConnectedProfile with versions that pass all requests to the underlying connected profile. Subclasses of ProfileWrapper may further override some of these methods as well as provide additional methods and fields.


Variable Index

 o baseProfile
The underlying connected profile.

Constructor Index

 o ProfileWrapper(ConnectedProfile)
Creates an connected profile wrapper built on top of the specified connected profile.

Method Index

 o close()
Calls the close method on the underlying connected profile.
 o getConnection()
Returns the result of calling the getConnection method on the underlying connected profile.
 o getProfileData()
Returns the result of calling the getProfileData method on the underlying connected profile.
 o getStatement(int)
Returns the result of calling the getStatement method on the underlying connected profile.
 o getWrappedProfile()
Returns the underlying connected profile to which all method implementations are deferred.
 o setWrappedProfile(ConnectedProfile)
Returns true if the underlying connected profile can be replaced with the passed connected profile, false otherwise.

Variables

 o baseProfile
 protected ConnectedProfile baseProfile
The underlying connected profile.

Constructors

 o ProfileWrapper
 public ProfileWrapper(ConnectedProfile profile)
Creates an connected profile wrapper built on top of the specified connected profile.

Parameters:
profile - the underlying connected profile.

Methods

 o getWrappedProfile
 public ConnectedProfile getWrappedProfile()
Returns the underlying connected profile to which all method implementations are deferred.

 o setWrappedProfile
 public boolean setWrappedProfile(ConnectedProfile newProfile)
Returns true if the underlying connected profile can be replaced with the passed connected profile, false otherwise. If true is returned, then the underlying connected profile will be replaced with the passed profile. If false is returned, the underlying profile is left unchanged. This method is useful for adding profile layering between existing layers as opposed to strictly to the top layer.

Note: the default implementation will always replace the underlying connected profile. Subclasses should override this method if non-default behavior is required.

 o getProfileData
 public ProfileData getProfileData()
Returns the result of calling the getProfileData method on the underlying connected profile.

 o getConnection
 public Connection getConnection()
Returns the result of calling the getConnection method on the underlying connected profile.

 o getStatement
 public RTStatement getStatement(int ndx) throws SQLException
Returns the result of calling the getStatement method on the underlying connected profile.

Throws: SQLException
if an error occurs in the wrapped profile
 o close
 public void close() throws SQLException
Calls the close method on the underlying connected profile.

Throws: SQLException
if an error occurs in the wrapped profile

All Packages    This Package  Previous  Next