Class SimpleSQLAdapter

  • All Implemented Interfaces:
    AdapterInterface, java.io.Serializable
    Direct Known Subclasses:
    SQLAdapter

    public abstract class SimpleSQLAdapter
    extends SimpleAdapter
    Abstract adapter dedicated to SQL statements input streams.
    The only methods to implement are the processQuery and processUpdate methods.
    This class (and its child classes) cannot be instanciated.
    They correspond to an Adapter configuration item.
    See Also:
    Serialized Form
    • Constructor Detail

      • SimpleSQLAdapter

        public SimpleSQLAdapter()
    • Method Detail

      • preProcess

        public java.lang.String preProcess()
        Description copied from class: SimpleAdapter
        Pre process.
        Called before processing lines, by default it sends the XML header to output.
        Specified by:
        preProcess in interface AdapterInterface
        Overrides:
        preProcess in class SimpleAdapter
        Returns:
        Error code to stop, or null to continue
      • getDataSource

        public final java.lang.String getDataSource()

        Get target datasource name (null means default datasource)

      • setDataSource

        public final void setDataSource​(java.lang.String datasource)

        Set target datasource name (null means default datasource)

      • process

        public void process()
                     throws java.lang.InterruptedException

        Processes each SQL statement
        Each result line is passed to the processQuery or processUpdate method for SQL result processing

        Throws:
        java.lang.InterruptedException
      • processSelect

        public abstract java.lang.String processSelect​(java.lang.String sql,
                                                       java.util.List<java.lang.String[]> rows)
                                                throws PlatformException,
                                                       java.lang.InterruptedException

        Select result processing

        Parameters:
        sql - SQL statement
        rows - Result rows (including headers)
        Throws:
        PlatformException
        java.lang.InterruptedException
      • processUpdate

        public abstract java.lang.String processUpdate​(java.lang.String sql,
                                                       int result)
                                                throws PlatformException,
                                                       java.lang.InterruptedException

        Update result processing

        Parameters:
        sql - SQL statement
        result - Result
        Throws:
        PlatformException
        java.lang.InterruptedException