Class UsingProperties
- java.lang.Object
-
- org.postgresql.pljava.example.annotation.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 aProperties
resource, and returns (key,value) rows from it by implementing theResultSetProvider
interface.- Author:
- Thomas Hallgren
-
-
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 theexample.properties
resource, one (key,value) row per entry.static org.postgresql.pljava.ResultSetProvider
propertyExampleRB()
Return the contents of theexample.properties
resource, one (key,value) row per entry, usingResourceBundle
to load it.
-
-
-
Constructor Detail
-
UsingProperties
public UsingProperties() throws IOException
- Throws:
IOException
-
-
Method Detail
-
assignRowValues
public boolean assignRowValues(ResultSet receiver, long currentRow) throws SQLException
- Specified by:
assignRowValues
in interfaceorg.postgresql.pljava.ResultSetProvider
- Specified by:
assignRowValues
in interfaceorg.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 theexample.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 theexample.properties
resource, one (key,value) row per entry, usingResourceBundle
to load it.- Throws:
SQLException
-
close
public void close()
- Specified by:
close
in interfaceorg.postgresql.pljava.ResultSetProvider
-
-