Git Product home page Git Product logo

Comments (4)

jcflack avatar jcflack commented on August 22, 2024

Hello,

I cannot read the localized messages, but from the SQLSTATE 42710 in the last screenshot, I infer it is saying the extension has already been created. Just a few comments:

  • there is no need for the pljava.classpath setting in postgresql.conf. PL/Java has not even had a variable by that name since a rather old version, so that line has no effect.
  • the extension does not create a language named pljava. It creates two languages by default, one named java and one named javaU. So try simply LANGUAGE java instead of LANGUAGE pljava.
  • it is not possible to simply put Java source, like return "Hello from Java!";, into the AS string. The AS string must refer to a public static method in a Java class that you have already compiled, and loaded into PostgreSQL in a jar file.
  • The best way to write the CREATE FUNCTION declaration properly is to let the Java compiler do it, using annotations you place on the method in the Java source.

There is a step-by-step "Hello, world"-style example here:

https://tada.github.io/pljava/use/hello.html

I am sorry that it is only available in English.

from pljava.

Houtx avatar Houtx commented on August 22, 2024

@jcflack
I found that the previous installation method was wrong, and I have successfully reinstalled pljava1.6.6 into postgresql15. Then I want to package a jar according to the sample program, but pljava-api cannot be found in maven. What is the reason or from which repository can I download dependency?

image

from pljava.

jcflack avatar jcflack commented on August 22, 2024

Building and uploading the api jar to an online repo has been on the wish list for a long time, but still needs attention. One complication is coordinating the use of the org.postgresql space, which the PL/Java project doesn't control.

But if you have installed PL/Java 1.6.6 on your PostgreSQL server, you already have the pljava-api-1.6.6.jar on your server, in $(pg_config --sharedir)/pljava and you can copy it from there, adding to your local Maven repository if that is what's most convenient.

Or, of course, if you build PL/Java from source using Maven, the API jar ends up in your local repository as a matter of course.

from pljava.

Houtx avatar Houtx commented on August 22, 2024

Building and uploading the api jar to an online repo has been on the wish list for a long time, but still needs attention. One complication is coordinating the use of the org.postgresql space, which the PL/Java project doesn't control.

But if you have installed PL/Java 1.6.6 on your PostgreSQL server, you already have the pljava-api-1.6.6.jar on your server, in $(pg_config --sharedir)/pljava and you can copy it from there, adding to your local Maven repository if that is what's most convenient.

Or, of course, if you build PL/Java from source using Maven, the API jar ends up in your local repository as a matter of course.

Thanks, following this program will solve it!

from pljava.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.