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 TypeMethodDescriptionbooleanassignRowValues(ResultSet receiver, long currentRow) voidclose()static ResultSetProviderReturn the contents of theexample.propertiesresource, one (key,value) row per entry.static ResultSetProviderReturn the contents of theexample.propertiesresource, one (key,value) row per entry, usingResourceBundleto load it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.postgresql.pljava.ResultSetProvider.Large
assignRowValues
-
Constructor Details
-
UsingProperties
- Throws:
IOException
-
-
Method Details
-
assignRowValues
- Specified by:
assignRowValuesin interfaceResultSetProvider- Specified by:
assignRowValuesin interfaceResultSetProvider.Large- Throws:
SQLException
-
propertyExampleAnno
@Function(type="javatest._properties", provides="propertyExampleAnno") public static ResultSetProvider propertyExampleAnno() throws SQLExceptionReturn the contents of theexample.propertiesresource, 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.propertiesresource, one (key,value) row per entry, usingResourceBundleto load it.- Throws:
SQLException
-
close
- Specified by:
closein interfaceResultSetProvider
-