PostgreSQL PL/Java – A How-To, Part 2: How to Manipulate and Return Tuples
source link: https://www.percona.com/blog/postgresql-pl-java-a-how-to-part-2-how-to-manipulate-and-return-tuples/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
PostgreSQL PL/Java – A How-To, Part 2: How to Manipulate and Return Tuples
Returning a Table Structure
Note that we are implementing the org.postgresql.pljava.ResultSetHandle interface provided by PL/Java. We need it because we are returning a complex object and the ResultSetHandle interface is appropriated when we don’t need to manipulate the returned tuples.
Now that we are using PL/Java objects we need to tell the compiler where to find those references and for this first example here we need the pljava-api jar, which in my case happens to be pljava-api-1.6.2.jar. If you remember from the first post I’ve compiled, the PL/Java I’m using here and my JAR file is located at “~/pljava-1_6_2/pljava-api/target/pljava-api-1.6.2.jar” and the compilation command will be:
Manipulating the Result Before Returning
Triggers
[1] https://github.com/elchinoo/blogs/tree/main/pljava
Percona Distribution for PostgreSQL provides the best and most critical enterprise components from the open-source community, in a single distribution, designed and tested to work together.
STAY UP-TO-DATE With Percona!
Join 33,000+ of your fellow open-source enthusiasts! Our newsletter provides updates on Percona open source software releases, technical resources, and valuable MySQL, MariaDB, PostgreSQL, and MongoDB-related articles. Get information about Percona Live, our technical webinars, and upcoming events and meetups where you can talk with our experts.
By submitting my information I agree that Percona may use my personal data in send communication to me about Percona services. I understand that I can unsubscribe from the communication at any time in accordance with the Percona Privacy Policy.
Author
A Brazilian living in China... Charly is passionate about new cultures, their languages and traditions. Charly has been working with database and development for more than 12 years and has participated in small and large projects in Brazil, the US, China and other countries.
Leave a Reply Cancel reply
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK