Skip to content

Commit

Permalink
Merge pull request #3608 from EnterpriseDB/docs/connectors/epas15-sup…
Browse files Browse the repository at this point in the history
…port

Connectors: EPAS 15 support
  • Loading branch information
drothery-edb authored Feb 14, 2023
2 parents 92c5403 + 249cf71 commit b0f7da9
Show file tree
Hide file tree
Showing 117 changed files with 1,819 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Release notes"
navigation:
- jdbc_42.5.1.2_rel_notes
- jdbc_42.5.1.1_rel_notes
- jdbc_42.5.0.1_rel_notes
---
Expand All @@ -11,6 +12,7 @@ These release notes describe what's new in each release. When a minor or patch r

| Version | Release Date |
| ---------------------------------------- | ------------ |
| [42.5.1.2](jdbc_42.5.1.2_rel_notes) | 2023 Feb 14 |
| [42.5.1.1](jdbc_42.5.1.1_rel_notes) | 2022 Dec 9 |
| [42.5.0.1](jdbc_42.5.0.1_rel_notes) | 2022 Sep 1 |
| [42.3.3.1](08_jdbc_42.3.3.1_rel_notes) | 2022 Apr 20 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Version 42.5.1.2"

---

The EDB JDBC connector provides connectivity between a Java application and an EDB Postgres Advanced Server database.

New features, enhancements, bug fixes, and other changes in the EDB JDBC Connector 42.5.1.2 include:

| Type | Description | |
| ----------- | ------------------------------------------------ | --- |
| Enhancement | Support for EDB Postgres Advanced Server 15.2.0. | |











Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ legacyRedirectsGenerated:

This table lists the latest JDBC Connector versions and their supported corresponding EDB Postgres Advanced Server (EPAS) versions. JDBC Connector is supported on the same platforms as EDB Postgres Advanced Server. See [Product Compatibility](https://www.enterprisedb.com/platform-compatibility#epas) for details.

| JDBC Connector | EPAS 14 | EPAS 13 | EPAS 12 | EPAS 11 |
| ---------------------------------------------------------- | ------- | ------- | ------- | ------- |
| [42.5.1.1](01_jdbc_rel_notes/jdbc_42.5.1.1_rel_notes) | Y | Y | Y | Y |
| [42.5.0.1](01_jdbc_rel_notes/jdbc_42.5.0.1_rel_notes) | Y | Y | Y | Y |
| [42.3.3.1](01_jdbc_rel_notes/08_jdbc_42.3.3.1_rel_notes) | Y | Y | Y | Y |
| [42.3.2.1](01_jdbc_rel_notes/09_jdbc_42.3.2.1_rel_notes) | Y | Y | Y | Y |
| [42.2.24.1](01_jdbc_rel_notes/10_jdbc_42.2.24.1_rel_notes) | Y | Y | Y | Y |
| [42.2.19.1](01_jdbc_rel_notes/12_jdbc_42.2.19.1_rel_notes) | N | Y | Y | Y |
| [42.2.12.3](01_jdbc_rel_notes/14_jdbc_42.2.12.3_rel_notes) | N | Y | Y | Y |
| [42.2.9.1](01_jdbc_rel_notes/16_jdbc_42.2.9.1_rel_notes) | N | N | Y | Y |
| [42.2.8.1](01_jdbc_rel_notes/18_jdbc_42.2.8.1_rel_notes) | N | N | Y | Y |
| JDBC Connector | EPAS 15 | EPAS 14 | EPAS 13 | EPAS 12 | EPAS 11 |
| ---------------------------------------------------------- | ------- | ------- | ------- | ------- | ------- |
| [42.5.1.2](01_jdbc_rel_notes/jdbc_42.5.1.2_rel_notes) | Y | Y | Y | Y | Y |
| [42.5.1.1](01_jdbc_rel_notes/jdbc_42.5.1.1_rel_notes) | N | Y | Y | Y | Y |
| [42.5.0.1](01_jdbc_rel_notes/jdbc_42.5.0.1_rel_notes) | N | Y | Y | Y | Y |
| [42.3.3.1](01_jdbc_rel_notes/08_jdbc_42.3.3.1_rel_notes) | N | Y | Y | Y | Y |
| [42.3.2.1](01_jdbc_rel_notes/09_jdbc_42.3.2.1_rel_notes) | N | Y | Y | Y | Y |
| [42.2.24.1](01_jdbc_rel_notes/10_jdbc_42.2.24.1_rel_notes) | N | Y | Y | Y | Y |
| [42.2.19.1](01_jdbc_rel_notes/12_jdbc_42.2.19.1_rel_notes) | N | N | Y | Y | Y |
| [42.2.12.3](01_jdbc_rel_notes/14_jdbc_42.2.12.3_rel_notes) | N | N | Y | Y | Y |
| [42.2.9.1](01_jdbc_rel_notes/16_jdbc_42.2.9.1_rel_notes) | N | N | N | Y | Y |
| [42.2.8.1](01_jdbc_rel_notes/18_jdbc_42.2.8.1_rel_notes) | N | N | N | Y | Y |

## Supported JDK distribution

Expand Down
10 changes: 10 additions & 0 deletions product_docs/docs/ocl_connector/15.2.0.1/01_ocl_release_notes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "Release notes"
---
The EDB OCL Connector provides an API similar to the Oracle Call Interface.

New features, enhancements, bug fixes, and other changes in the EDB OCL Connector 15.2.0.1 include:

| Type | Description |
| ----------- | -------------------------------------------------------- |
| Enhancement | Support for EDB Postgres Advanced Server version 15.2.0. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Product compatibility"

---

<div id="supported_platforms" class="registered_link"></div>

The EDB OCL Connector is certified with EDB Postgres Advanced Server version 11 and later. The EDB Connector is supported on the same platforms as EDB Postgres Advanced Server. See [Platform Compatibility](https://www.enterprisedb.com/platform-compatibility#epas) for details.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "libpq cross-version compatibility"

---

<div id="libpq_compatibility" class="registered_link"></div>

EDB OCL installation always uses the latest libpq. The different scenarios supported under libpq cross-version compatibility are as following:

- If the latest libpq is installed on the machine, OCL uses it.
- If the latest libpq isn't already installed, OCL installs it. It doesn't use the existing libpq of older versions even if it's installed.
- If you upgrade the OCL version, then libpq is also upgraded to its latest version.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Forming a connection string"

---

<div id="forming_a_connection_string" class="registered_link"></div>

The EDB OCL Connector accepts both Oracle-style and Postgres-style connection URIs. A connection string can take the following Oracle-style form:

`[//][host][:port][/dbname]`

Or it can take the following Postgres-style forms:

```text
postgres://[user[:password]@][host][:port][/dbname]
[?param1=value1&...]
```

```text
postgresql://[user[:password]@][host][:port][/dbname]
[?param1=value1&...]
```

You can also use a Postgres-style URI to specify multiple host components (each with an optional port component) in a single URI. A multi-host connection string takes the form:

`postgresql://<user>:<password>@host1:port1,host2:port2,host3:port3/`

Where:

`user` is the name of the connecting user.

`password` is the password associated with the connecting user.

`host` is the host name or IP address to which you are connecting. To specify an IPV6 address, enclose the address in square brackets.

`port` is the port number to which you are connecting.

`dbname` is the name of the database with which you are connecting.

`paramx=valuex` pairs specify extra (application-specific) connection properties.

For example, each of the following connection strings establishes a connection to the `edb` database on port `5444` of a system with an IP address of `10.0.0.4`:

`//10.0.0.4:5444/edb`
`postgres://<user>:<password>@10.0.0.4:5444/edb`
`postgresql://<user>:<password>@10.0.0.4:5444/edb`

For more information about using Postgres-style connection strings, see the [PostgreSQL core documentation](https://www.postgresql.org/docs/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Compiling and linking a program"

---

<div id="compiling_and_linking_a_program" class="registered_link"></div>

The EDB Open Client Library allows applications written using the Oracle Call Interface API to connect to and access an EDB database with minimal changes to the C source code. The EDB Open Client Library files are named:

On Linux:

`libedboci.so`

On Windows:

`edboci.dll`

The files are installed in the `oci/lib` subdirectory.

## Compiling and linking a sample program

This example compiles and links the sample program `edb_demo.c` in a Linux environment. The `edb_demo.c` file is located in the `oci/samples` subdirectory.

1. Set the `ORACLE_HOME` and `EDB_HOME` environment variables.

2. Set `ORACLE_HOME` to the complete pathname of the Oracle home directory.

For example:

`export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server`

3. Set `EDB_HOME` to the complete pathname of the home directory.

For example:

`export EDB_HOME=/usr/edb`

4. Set `LD_LIBRARY_PATH` to the complete path of `libpthread.so`. By default, `libpthread.so` is located in `/lib64`.

`export LD_LIBRARY_PATH=/lib64/lib:$LD_LIBRARY_PATH`

5. Set `LD_LIBRARY_PATH` to include the EDB Postgres Advanced Server Open Client library. By default, `libedboci.so` is located in `$EDB_HOME/oci/lib`.

`export LD_LIBRARY_PATH=$EDB_HOME/oci:$EDB_HOME/oci/lib:$LD_LIBRARY_PATH`

6. Then, compile and link the OCL API program.

`cd $EDB_HOME/oci/samples`

`make`
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: "Ref cursor support"

---

<div id="ref_cursor_support" class="registered_link"></div>

The EDB Postgres Advanced Server Open Client Library supports the use of `REF CURSOR` as `OUT` parameters in PL/SQL procedures that are compatible with Oracle. Support is provided through the following APIs:

- `OCIBindByName`
- `OCIBindByPos`
- `OCIBindDynamic`
- `OCIStmtPrepare`
- `OCIStmtExecute`
- `OCIStmtFetch`
- `OCIAttrGet`

The EDB OCL Connector also supports the `SQLT_RSET` data type.

This example invokes a stored procedure that opens a cursor and returns a `REF CURSOR` as an output parameter. The code sample assumes that a PL/SQL procedure named `openCursor` (with an `OUT` parameter of type `REF CURSOR`) was created on the database server and that the required handles were allocated:

```c
char* openCursor = "begin \
openCursor(:cmdRefCursor); \
end;";
OCIStmt* stmtOpenRefCursor;
OCIStmt* stmtUseRefCursor;
```

Allocate handles for executing a stored procedure to open and use the `REF CURSOR`:

```c
/* Handle for the stored procedure to open the ref cursor */
OCIHandleAlloc((dvoid *) envhp,
(dvoid **) &stmtOpenRefCursor,
OCI_HTYPE_STMT,
0,
(dvoid **) NULL));
```
```c
/* Handle for using the Ref Cursor */
OCIHandleAlloc((dvoid *) envhp,
(dvoid **) &stmtUseRefCursor,
OCI_HTYPE_STMT,
0,
(dvoid **) NULL));
```

Then, prepare the PL/SQL block that's used to open the `REF CURSOR`:

```c
OCIStmtPrepare(stmtOpenRefCursor,
errhp,
(text *) openCursor,
(ub4) strlen(openCursor),
OCI_NTV_SYNTAX,
OCI_DEFAULT));
```
Bind the PL/SQL `openCursor OUT` parameter:
```c
OCIBindByPos(stmtOpenRefCursor,
&bndplrc1,
errhp,
1,
(dvoid*) &stmtUseRefCursor,
/* the returned ref cursor */
0,
SQLT_RSET,
/* SQLT_RSET type representing cursor */
(dvoid *) 0,
(ub2 *) 0,
(ub2) 0,
(ub4) 0,
(ub4 *) 0,
OCI_DEFAULT));
```

Use the `stmtOpenRefCursor` statement handle to call the `openCursor` procedure:

```c
OCIStmtExecute(svchp,
stmtOpenRefCursor,
errhp,
1,
0,
0,
0,
OCI_DEFAULT);
```
At this point, the `stmtUseRefCursor` statement handle contains the reference to the cursor. To obtain the information, define output variables for the ref cursor:
```c
/* Define the output variables for the ref cursor */
OCIDefineByPos(stmtUseRefCursor,
&defnEmpNo,
errhp,
(ub4) 1,
(dvoid *) &empNo,
(sb4) sizeof(empNo),
SQLT_INT,
(dvoid *) 0,
(ub2 *)0,
(ub2 *)0,
(ub4) OCI_DEFAULT));
```

Then, fetch the first row of the result set into the target variables:

```c
/* Fetch the cursor data */
OCIStmtFetch(stmtUseRefCursor,
errhp,
(ub4) 1,
(ub4) OCI_FETCH_NEXT,
(ub4) OCI_DEFAULT))
```
Loading

1 comment on commit b0f7da9

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.