Class SetOfRecordTest
- java.lang.Object
-
- org.postgresql.pljava.example.annotation.SetOfRecordTest
-
- All Implemented Interfaces:
org.postgresql.pljava.ResultSetHandle
@SQLAction(requires="selecttorecords fn", install=" SELECT CASE WHEN r IS DISTINCT FROM ROW(\'Foo\'::varchar, 1::integer, 1.5::float, 23.67::decimal(8,2), \'2005-06-01\'::date, \'20:56\'::time, \'192.168\'::cidr) THEN javatest.logmessage(\'WARNING\', \'SetOfRecordTest not ok\') ELSE javatest.logmessage(\'INFO\', \'SetOfRecordTest ok\') END FROM javatest.executeselecttorecords( \'select \'\'Foo\'\', 1, 1.5::float, 23.67, \'\'2005-06-01\'\', \'\'20:56\'\'::time, \'\'192.168.0\'\'\') AS r(t_varchar varchar, t_integer integer, t_float float, t_decimal decimal(8,2), t_date date, t_time time, t_cidr cidr)") public class SetOfRecordTest extends Object implements org.postgresql.pljava.ResultSetHandle
Example implementing theResultSetHandle
interface, to return theResultSet
from any SQLSELECT
query passed as a string to theexecuteSelect
function.
-
-
Constructor Summary
Constructors Constructor Description SetOfRecordTest(String selectSQL)
-
Method Summary
Modifier and Type Method Description void
close()
static org.postgresql.pljava.ResultSetHandle
executeSelect(String selectSQL)
ResultSet
getResultSet()
-
-
-
Constructor Detail
-
SetOfRecordTest
public SetOfRecordTest(String selectSQL) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
executeSelect
@Function(schema="javatest", name="executeselecttorecords", provides="selecttorecords fn") public static org.postgresql.pljava.ResultSetHandle executeSelect(String selectSQL) throws SQLException
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceorg.postgresql.pljava.ResultSetHandle
- Throws:
SQLException
-
getResultSet
public ResultSet getResultSet() throws SQLException
- Specified by:
getResultSet
in interfaceorg.postgresql.pljava.ResultSetHandle
- Throws:
SQLException
-
-