Class UsingProperties

  • All Implemented Interfaces:
    org.postgresql.pljava.ResultSetProvider, org.postgresql.pljava.ResultSetProvider.Large

    @SQLAction(requires={"propertyExampleAnno","propertyExampleRB"},
               install={"WITH expected AS (VALUES  (\'adjective\' ::varchar(200), \'avaricious\' ::varchar(200)),  (\'noun\',                     \'platypus\') )SELECT  CASE WHEN   2 = count(prop) AND every(prop IN (SELECT expected FROM expected))  THEN javatest.logmessage(\'INFO\',    \'get resource passes\')  ELSE javatest.logmessage(\'WARNING\', \'get resource fails\')  END FROM  propertyExampleAnno() AS prop","WITH expected AS (VALUES  (\'adjective\' ::varchar(200), \'avaricious\' ::varchar(200)),  (\'noun\',                     \'platypus\') )SELECT  CASE WHEN   2 = count(prop) AND every(prop IN (SELECT expected FROM expected))  THEN javatest.logmessage(\'INFO\',    \'get ResourceBundle passes\')  ELSE javatest.logmessage(\'WARNING\', \'get ResourceBundle fails\')  END FROM  propertyExampleRB() AS prop"})
    public class UsingProperties
    extends Object
    implements org.postgresql.pljava.ResultSetProvider.Large
    An example that retrieves a Properties resource, and returns (key,value) rows from it by implementing the ResultSetProvider interface.
    Author:
    Thomas Hallgren
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.postgresql.pljava.ResultSetProvider

        org.postgresql.pljava.ResultSetProvider.Large
    • Constructor Summary

      Constructors 
      Constructor Description
      UsingProperties()  
    • Method Summary

      Modifier and Type Method Description
      boolean assignRowValues​(ResultSet receiver, long currentRow)  
      void close()  
      static org.postgresql.pljava.ResultSetProvider propertyExampleAnno()
      Return the contents of the example.properties resource, one (key,value) row per entry.
      static org.postgresql.pljava.ResultSetProvider propertyExampleRB()
      Return the contents of the example.properties resource, one (key,value) row per entry, using ResourceBundle to load it.
      • Methods inherited from interface org.postgresql.pljava.ResultSetProvider.Large

        assignRowValues
    • Method Detail

      • assignRowValues

        public boolean assignRowValues​(ResultSet receiver,
                                       long currentRow)
                                throws SQLException
        Specified by:
        assignRowValues in interface org.postgresql.pljava.ResultSetProvider
        Specified by:
        assignRowValues in interface org.postgresql.pljava.ResultSetProvider.Large
        Throws:
        SQLException
      • propertyExampleAnno

        @Function(type="javatest._properties",
                  provides="propertyExampleAnno")
        public static org.postgresql.pljava.ResultSetProvider propertyExampleAnno()
                                                                           throws SQLException
        Return the contents of the example.properties resource, one (key,value) row per entry.
        Throws:
        SQLException
      • propertyExampleRB

        @Function(type="javatest._properties",
                  provides="propertyExampleRB")
        public static org.postgresql.pljava.ResultSetProvider propertyExampleRB()
                                                                         throws SQLException
        Return the contents of the example.properties resource, one (key,value) row per entry, using ResourceBundle to load it.
        Throws:
        SQLException
      • close

        public void close()
        Specified by:
        close in interface org.postgresql.pljava.ResultSetProvider