FileDocCategorySizeDatePackage
PLSQLCustomization.javaAPI DocExample2094Fri Oct 01 15:08:58 BST 1999None

PLSQLCustomization

public class PLSQLCustomization extends Object implements sqlj.runtime.profile.Customization
A PLSQL customization contains a customized version of a profile data object. The customized version of the data uses calls to PLSQL stored procedures instead of the client's original SQL operations.

Fields Summary
private sqlj.runtime.profile.ProfileData
m_customData
Constructors Summary
public PLSQLCustomization(sqlj.runtime.profile.ProfileData customData)
Creates a new customization using the passed custom data. The custom data will be serialized with this customization, and can thus be used at runtime when a custom connected profile is created by this customization.

    m_customData = customData;
  
Methods Summary
public booleanacceptsConnection(java.sql.Connection conn)
Returns true if the connection's database product name is ORACLE, false otherwise.

    try {
      DatabaseMetaData dbmd = conn.getMetaData();
      String dbName = dbmd.getDatabaseProductName();
      return dbName.equalsIgnoreCase("ORACLE");
    } catch (SQLException e) {
      return false;
    }
  
public sqlj.runtime.profile.ConnectedProfilegetProfile(java.sql.Connection conn, sqlj.runtime.profile.Profile baseProfile)
Returns a connected profile for the baseProfile on the given jdbc connection. The connected profile makes calls to PLSQL stored procedures, as described by the underlying custom profile data. Note that we reuse the "default" connected profile implementation, creating it with a custom profile data object rather than the default profile data.

exception
java.sql.SQLException if a default connected profile cannot be created.

    System.out.println("creating plsql custom profile");
    return ProfileImpl.getDefaultProfile(conn, m_customData);