Class StatementParameter

  • All Implemented Interfaces:
    JdbcStatementParameter

    public class StatementParameter
    extends StatementParameterImpl
    Encapsulates a parameter that is used by the JdbcDataCaptureService.

    In the adapter configuration file this class is aliased as jdbc-statement-parameter which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • StatementParameter

        public StatementParameter()
      • StatementParameter

        public StatementParameter​(java.lang.String query,
                                  java.lang.String classname,
                                  StatementParameterImpl.QueryType type,
                                  java.lang.Boolean nullConvert)
      • StatementParameter

        public StatementParameter​(java.lang.String query,
                                  java.lang.String classname,
                                  StatementParameterImpl.QueryType type,
                                  java.lang.Boolean nullConvert,
                                  java.lang.String paramName)
      • StatementParameter

        public StatementParameter​(java.lang.String query,
                                  java.lang.Class<?> clazz,
                                  StatementParameterImpl.QueryType type,
                                  java.lang.Boolean nullConvert)
    • Method Detail

      • apply

        public void apply​(int parameterIndex,
                          java.sql.PreparedStatement statement,
                          AdaptrisMessage msg)
                   throws java.sql.SQLException,
                          ServiceException
        Description copied from interface: JdbcStatementParameter
        Apply this statement parameter to the PreparedStatement.
        Parameters:
        parameterIndex - the index in the PreparedStatement
        statement - the PreparedStatement
        msg - the AdaptrisMessage
        Throws:
        java.sql.SQLException - on exception
        ServiceException
      • setQueryClass

        public void setQueryClass​(java.lang.String clazz)
        The type of underlying jdbc object.
        Parameters:
        clazz - the clas type.
      • getQueryClass

        public java.lang.String getQueryClass()
        Return the type of the underlying jdbc object.
        Returns:
        the type.
      • convertToQueryClass

        protected java.lang.Object convertToQueryClass​(java.lang.Object value)
                                                throws ServiceException
        Convert the given string to the corresponding query class.
        Parameters:
        value - the string obtained.
        Returns:
        an Object suitable for use in the service.
        Throws:
        ServiceException - on error.