interMedia BC4J Integration

oracle.ord.im
Class NotConnectedException

oracle.ord.im.OrdJboException
  |
  +--oracle.ord.im.NotConnectedException

public class NotConnectedException
extends OrdJboException

Signals the method requires a JDBC connection to the database but the interMedia domain object is not yet connected to the database.

Many of the methods of the interMedia domain classes require a database connection. For example: deleteContent and loadDataFromFile both require a connection.

While the domain object instantiated by the Business Components for Java (BC4J) framework to represent the interMedia database object has a database connection, the domain object created by the Java program does not have one. Users should first set a database connection into non-BC4J created domain objects before invoking methods requiring a connection.

To get a connection for the newly created domain object, the user needs to call the postChanges method.

        OrdImageDomain imgDomain = new OrdImageDomain();
        Row row = vo.createRow();
        row.setAttribute("Image", imgDomain);
        viewObject.insertRow(row);
        appModule.getTransaction().postChanges();
        // From this point on, the imgDomain object gets the connection
 

Note the postChanges posts the row into the database, then the row gets selected back, finally the image object gets selected back with the JDBC connection.

Since:
JDev5.0

Constructor Summary
NotConnectedException(java.lang.String methodName, java.lang.String className)
          Constructs a NotConnectedException instance.
 
Methods inherited from class oracle.ord.im.OrdJboException
getProductCode, getResourceName
 

Constructor Detail

NotConnectedException

public NotConnectedException(java.lang.String methodName,
                             java.lang.String className)
Constructs a NotConnectedException instance.
Parameters:
methodName - the name of the method requiring the database connection
className - the class name of the domain object

interMedia BC4J Integration