PL/Java

Availability

This feature is available since openGauss 1.0.0.

Introduction

The Java user-defined field (UDF) is supported.

Benefits

A development environment is provided for multiple functions.

Description

With the openGauss PL/Java function, you can choose your favorite Java IDE to write Java methods and install the JAR files containing these methods into openGauss before invoking them. openGauss PL/Java is developed based on open-source tada PL/Java 1.5.2. PL/Java uses Huawei JDK V100R001C00SPC190B003-b09.

Enhancements

None

Constraints

  • Java UDFs can implement simple Java computing. However, do not encapsulate services in Java UDFs.

  • Do not connect to a database in any way (for example, JDBC) in Java functions.

  • Use Huawei JDK V100R001C00SPC190B003-b09 to compile Java methods and JAR files.

  • Currently, only data types listed in Table 1 are supported. Other data types, such as user-defined data types and complex data types (for example, Java array and its derived types) are not supported.

  • Currently, UDAF and UDTF are not supported.

    Table 1 PL/Java mapping for default data types

    openGauss

    Java

    BOOLEAN

    boolean

    "char"

    byte

    bytea

    byte[]

    SMALLINT

    short

    INTEGER

    int

    BIGINT

    long

    FLOAT4

    float

    FLOAT8

    double

    CHAR

    java.lang.String

    VARCHAR

    java.lang.String

    TEXT

    java.lang.String

    name

    java.lang.String

    DATE

    java.sql.Timestamp

    TIME

    java.sql.Time (stored value treated as local time)

    TIMETZ

    java.sql.Time

    TIMESTAMP

    java.sql.Timestamp

    TIMESTAMPTZ

    java.sql.Timestamp

Dependencies

PL/Java depends on the Java Development Kit (JDK) environment. Currently, JDK is included in openGauss and installation is not required. If you have installed the same or different versions of JDK, no conflict will occur. openGauss uses Huawei JDK V100R001C00SPC190B003-b09 to run PL/Java.

Feedback
编组 3备份
    openGauss 2024-05-05 00:44:49
    cancel