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
ResultSetProviderto return 100 rows of twobyteacolumns each, which should be equal in each row, one being set byupdateBinaryStreamand the other byupdateBytes.Example implementingResultSetProviderto 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 acallMetaDatafunction taking a string that supplies the name of, and arguments to, anyResultSet-returningDatabaseMetaDatamethod, and returns a single-columnvarcharresult, the first row a header, then one for eachResultSetrow, semicolons delimiting the original columns.Provides afunctionproducing as many rows as requested, each with a random int.Provides afunctionthat takes any SQLSELECTquery as a string, executes it, and returns theResultSetproduced as a single string column, the first row being a header, then one per row of theResultSet, semicolons delimiting the original columns.Provides acreateTempFilefunction, expected to fail if it is declared with the trustedjavalanguage.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 theResultSetHandleinterface to implement two functions,listNonSupersandlistSupers, returning the corresponding subsets of rows frompg_user.Illustrates use of theResultSetProviderinterface to return (key,value) rows from theexample.propertiesfile, also making use of PL/Java'sObjectPoolfacility.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.