Package org.postgresql.pljava.example
package org.postgresql.pljava.example
The examples that have been around the longest, and are deployed using
hand-written SQL deployment code (see
src/main/resources/deployment
),
not having been reworked to use annotations yet.- Author:
- Thomas Hallgren
-
ClassesClassDescriptionExample using
ResultSetProvider
to return 100 rows of twobytea
columns each, which should be equal in each row, one being set byupdateBinaryStream
and the other byupdateBytes
.Example implementingResultSetProvider
to provide a function that generates and returns a lot of rows (caller passes the desired row count) each containing the row number, a random integer, and a timestamp.Provides a function to log, at the specified level, a specified message.Example returning (varchar,boolean) rows, one for each boolean-valued attribute in the JDBCDatabaseMetaData
.Example returning (varchar,int) rows, one for each int-valued attribute in the JDBCDatabaseMetaData
.Example returning (varchar,varchar) rows, one for each String-valued attribute in the JDBCDatabaseMetaData
.Provides acallMetaData
function taking a string that supplies the name of, and arguments to, anyResultSet
-returningDatabaseMetaData
method, and returns a single-columnvarchar
result, the first row a header, then one for eachResultSet
row, semicolons delimiting the original columns.Provides afunction
producing as many rows as requested, each with a random int.Provides afunction
that takes any SQLSELECT
query as a string, executes it, and returns theResultSet
produced as a single string column, the first row being a header, then one per row of theResultSet
, semicolons delimiting the original columns.Provides acreateTempFile
function, expected to fail if it is declared with the trustedjava
language.This class contains thread related methods.This class contains some triggers that I found written in C under the contrib/spi directory of the postgres source distribution.Illustrates various methods of returning composite values.Uses theResultSetHandle
interface to implement two functions,listNonSupers
andlistSupers
, returning the corresponding subsets of rows frompg_user
.Illustrates use of theResultSetProvider
interface to return (key,value) rows from theexample.properties
file, also making use of PL/Java'sObjectPool
facility.This implementation uses another function that returns a set of a complex type and returns the ResultSet produced by a query.This implementation uses another function that returns a set of a complex type, concatenates the name and value of that type and returns this as a set of a scalar type.