com.ibm.commerce.messaging.adapters.jcasample

Class SampleConnection

  • java.lang.Object
    • com.ibm.commerce.messaging.adapters.jcasample.SampleConnection
  • All Implemented Interfaces:
    javax.resource.cci.Connection


    public class SampleConnection
    extends java.lang.Object
    implements javax.resource.cci.Connection
    This class implements the Connection interface, which is a client handle of the physical connection.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright statement.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      This method closes the sample managed connection.
      javax.resource.cci.Interaction createInteraction()
      This methods creates a new SampleInteraction.
      boolean getAutoCommit()
      This method gets whether auto commit is enabled.
      javax.resource.cci.LocalTransaction getLocalTransaction()
      This method gets the local transaction.
      SampleManagedConnection getManagedConnection()
      This method provides access to the sample managed connection.
      javax.resource.cci.ConnectionMetaData getMetaData()
      This method gets the connections metadata.
      javax.resource.cci.ResultSetInfo getResultSetInfo()
      This method gets information on the result set.
      void setAutoCommit(boolean param)
      This method sets auto commit.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        Copyright statement.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SampleConnection

        public SampleConnection(SampleManagedConnection smc)
                         throws javax.resource.ResourceException
        The default constructor.
        Parameters:
        SampleManagedConnection - The managed connection.
        Throws:
        javax.resource.ResourceException - If a J2EE resource exception is thrown.
    • Method Detail

      • getManagedConnection

        public SampleManagedConnection getManagedConnection()
        This method provides access to the sample managed connection.
        Returns:
        The SampleManagedConection.
      • close

        public void close()
                   throws javax.resource.ResourceException
        This method closes the sample managed connection.
        Specified by:
        close in interface javax.resource.cci.Connection
        Throws:
        javax.resouce.ResourceException - Raised if the connection cannot close successfully.
        javax.resource.ResourceException
      • createInteraction

        public javax.resource.cci.Interaction createInteraction()
                                                         throws javax.resource.ResourceException
        This methods creates a new SampleInteraction.
        Specified by:
        createInteraction in interface javax.resource.cci.Connection
        Returns:
        The newly created SampleInteraction.
        Throws:
        javax.resource.ResourceException - If the interaction cannot be created.
      • getAutoCommit

        public boolean getAutoCommit()
                              throws javax.resource.ResourceException
        This method gets whether auto commit is enabled.
        Returns:
        This method always returns true.
        Throws:
        javax.resource.ResourceException
        See Also:
        Connection getAutoCommit()
      • setAutoCommit

        public void setAutoCommit(boolean param)
                           throws javax.resource.ResourceException
        This method sets auto commit. If param is false a ResouceException will be raised.
        Parameters:
        param - True if auto commit; false otherwise.
        Throws:
        javax.resource.ResourceException - Raised if param is false.
      • getLocalTransaction

        public javax.resource.cci.LocalTransaction getLocalTransaction()
                                                                throws javax.resource.ResourceException
        This method gets the local transaction.
        Specified by:
        getLocalTransaction in interface javax.resource.cci.Connection
        Returns:
        Always return null. There is no implementation provided in this sample method.
        Throws:
        javax.resource.ResourceException
      • getResultSetInfo

        public javax.resource.cci.ResultSetInfo getResultSetInfo()
                                                          throws javax.resource.ResourceException
        This method gets information on the result set.
        Specified by:
        getResultSetInfo in interface javax.resource.cci.Connection
        Returns:
        Always return null. There is no implementation provided in this sample method.
        Throws:
        javax.resource.ResourceException
      • getMetaData

        public javax.resource.cci.ConnectionMetaData getMetaData()
                                                          throws javax.resource.ResourceException
        This method gets the connections metadata.
        Specified by:
        getMetaData in interface javax.resource.cci.Connection
        Returns:
        The SampleConnectionMetaData
        Throws:
        javax.resource.ResourceException - If any exception occured.