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
-
Class Summary Class Description BinaryColumnTest Example usingResultSetProvider
to return 100 rows of twobytea
columns each, which should be equal in each row, one being set byupdateBinaryStream
and the other byupdateBytes
.HugeResultSet 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.LoggerTest Provides a function to log, at the specified level, a specified message.MetaDataBooleans Example returning (varchar,boolean) rows, one for each boolean-valued attribute in the JDBCDatabaseMetaData
.MetaDataInts Example returning (varchar,int) rows, one for each int-valued attribute in the JDBCDatabaseMetaData
.MetaDataStrings Example returning (varchar,varchar) rows, one for each String-valued attribute in the JDBCDatabaseMetaData
.MetaDataTest 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.RandomInts Provides afunction
producing as many rows as requested, each with a random int.ResultSetTest 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.Security Provides acreateTempFile
function, expected to fail if it is declared with the trustedjava
language.Threads This class contains thread related methods.Triggers This class contains some triggers that I found written in C under the contrib/spi directory of the postgres source distribution.TupleReturn Illustrates various methods of returning composite values.Users Uses theResultSetHandle
interface to implement two functions,listNonSupers
andlistSupers
, returning the corresponding subsets of rows frompg_user
.UsingProperties Illustrates use of theResultSetProvider
interface to return (key,value) rows from theexample.properties
file, also making use of PL/Java'sObjectPool
facility.UsingPropertiesAsResultSet This implementation uses another function that returns a set of a complex type and returns the ResultSet produced by a query.UsingPropertiesAsScalarSet 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.