Class UsingProperties
java.lang.Object
org.postgresql.pljava.example.annotation.UsingProperties
- All Implemented Interfaces:
ResultSetProvider
,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 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
ResultSetProvider.Large
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
assignRowValues
(ResultSet receiver, long currentRow) void
close()
static ResultSetProvider
Return the contents of theexample.properties
resource, one (key,value) row per entry.static ResultSetProvider
Return the contents of theexample.properties
resource, one (key,value) row per entry, usingResourceBundle
to load it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.postgresql.pljava.ResultSetProvider.Large
assignRowValues
-
Constructor Details
-
UsingProperties
- Throws:
IOException
-
-
Method Details
-
assignRowValues
- Specified by:
assignRowValues
in interfaceResultSetProvider
- Specified by:
assignRowValues
in interfaceResultSetProvider.Large
- Throws:
SQLException
-
propertyExampleAnno
@Function(type="javatest._properties", provides="propertyExampleAnno") public static ResultSetProvider propertyExampleAnno() throws SQLExceptionReturn the contents of theexample.properties
resource, one (key,value) row per entry.- Throws:
SQLException
-
propertyExampleRB
@Function(type="javatest._properties", provides="propertyExampleRB") public static ResultSetProvider propertyExampleRB() throws SQLExceptionReturn the contents of theexample.properties
resource, one (key,value) row per entry, usingResourceBundle
to load it.- Throws:
SQLException
-
close
- Specified by:
close
in interfaceResultSetProvider
-