Questions tagged [pljava]

PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, and Functions to the PostgreSQL™ backend.

The development started late 2003 and the first release of PL/Java arrived in January 2005. The project is released under the PLJava License license.

Features

  • Ability to write both functions and triggers using Java 1.4 or higher.
  • Standardized utilities (modeled after the SQL 2003 proposal) to install and maintain Java code in the database.
  • Standardized mappings of parameters and result. Supports scalar and composite UDT's, pseudo types, arrays, and sets.
  • An embedded, high performance, JDBC driver utilizing the internal PostgreSQL SPI routines.
  • Metadata support for the JDBC driver. Both DatabaseMetaData and ResultSetMetaData are included.
  • Full support for PostgreSQL 8.0 savepoints and exception handling.
  • Ability to use IN, INOUT, and OUT parameters when used with PostgreSQL 8.1 or higher.
  • Two language handlers, one TRUSTED (the default) and one that is not TRUSTED (language tag is javaU to conform with the defacto standard).
  • Transaction and Savepoint listeners enabling code execution when a transaction or savepoint is committed or rolled back.
  • Integration with GNU GCJ on selected platforms.

More information about this project can be found in the PL/Java Wiki

36 questions
0
votes
2 answers

Install PLJava in Postgresql 14.7 running on Ubuntu 22.04 - maven clean install fails

I have installed the following in Ubuntu 22.04: g++ gcc openjdk maven postgresql 14.7 openssl I checked the above are installed correctly: oot@ubuntu:~# g++ --version g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Copyright (C) 2021 Free Software…
0
votes
1 answer

java.lang.SecurityException: JAR file trying to read txt file (Pljava)

I am trying to package a JAR where some classes may need to read a txt file. I include the txt file in the root directory of the JAR package. This JAR package gets loaded on Pl/Java. However, when trying to execute in PLjava, it returns the…
Larry
  • 11,439
  • 15
  • 61
  • 84
0
votes
1 answer

Problems setting JARs to classpath in Pl/Java

I seem to be having a problem setting multiple JAR files to the classpath for Pl/Java. For each JAR file, I have installed the JARs, using install_jar. But what I now need to do is add each JAR to the classpath, I try the following: SELECT…
Larry
  • 11,439
  • 15
  • 61
  • 84
0
votes
1 answer

PostgreSQL view to read another table, transform data and return results

Could some please suggest the best way to implement this: Essentially what I want to have is a virtual-table in PostgreSQL that when queried, it looks up the data from some other table (call this the raw-data table). But the catch is, the data from…
Larry
  • 11,439
  • 15
  • 61
  • 84
0
votes
1 answer

Installing PL/Java on MAC

I’m really having trouble installing Pl/Java on Mac, any help would be appreciated. I’ll describe the exact steps I’ve done in accordance with the README here, but I still get some errors that I cannot resolve. (1) I’ve downloaded this version:…
Larry
  • 11,439
  • 15
  • 61
  • 84
0
votes
2 answers

How to deploy compiled PL/Java code straight to Postgres database from application?

I have set up a Postgres database server with PL/Java binary installed on it. I have observed the process of getting an example PL/Java code to install and run on the database as it starts with moving the compiled .jar file from application server…
Silence
  • 73
  • 3
  • 12
0
votes
1 answer

Missing type mapping byte[] to bytea - plJava

i want to execute a plJava function like: @Function public static byte[] enrypt_rsa(String message, byte[] public_key) {...} But if i try to create a .jar file with maven (mvn clean package) i get the following Error message: 'No known mapping to…
0
votes
0 answers

CREATE EXTENSION pljava failed on PostgreSql 9.6

I try to install pljava for postgesql 9.6 in Ubuntu 16.04, but it fails with error. A gradlew script makes an installation, but it fails with the following error" Failed to execute: CREATE EXTENSION pljava; because: ERROR: could not access file…
0
votes
1 answer

pljava installation 1.5.1-snapshot on postgresql 10beta2 - undefined symbol: DatumGetFloat8

When installing pljava-1.5.1-snapshot on postgresql 10b2 I get undefined symbol: DatumGetFloat8 when executing create extension pljava; Works for me on postgres96. Is there an issue installing pljava on the upcomming postgresql version? Can…
0
votes
2 answers

Issues while installing "sqlj" schema using pljava in postgres 9.3 for windows 7

I am trying to install Postgres 9.3.16 on Windows7 (64 bit operating system). While Installing sqlj schema using pljava and the following command: java -cp…
Neelam
  • 360
  • 4
  • 14
0
votes
1 answer

install pljava on Windows 7 with Postgres 9.6

I am struggling to install pljava on Windows 7 Sp1 with Postgres 9.6. When I run the following command: CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C; I receive the following error: ERROR: could not load…
Siva
  • 1
0
votes
1 answer

Postgres PL/JAVA: java.lang.ClassNotFoundException error after loading JAR file in database

I am getting the java.lang.ClassNotFoundException: error inside Postgres when running a function that calls a JAR file I have loaded. I have installed and configured PL/JAVA (including the delivered examples) in my database and can run the examples…
0
votes
0 answers

Postgres Listener - Pull last inserted/deleted row

I'm trying to create a database listener (postgres) in Java. Every time a user inserts or deletes an entry of a table I want to receive the value that was inserted or deleted, respectively. For that I created a trigger, as depicted bellow, that…
Pedro Chaves
  • 123
  • 13
0
votes
2 answers

postgresql-9.3-pljava-gcj for 64 bit architecture

I need to install pljava for postgresql 9.3 on Ubuntu 14.04. I installed the 64bit version of postgre using the apt-get packet manager of Ubuntu, and I tried installing pljava in the same way sudo apt-get install postgresql-9.3-pljava-gcj but it…
McKracken
  • 389
  • 4
  • 17
0
votes
1 answer

Error: java.lang.SecurityException: execute on /home//test.sh JAR file trying to read shell file (Pljava)

I am trying to call a pl/Sql function which calls a Java class and it reads a shell file and execute the same. I placed this shell file in my home directory. I created a JAR using that class and installed in PostgreSQL. However, when trying to…