Skip to content

Commit

Permalink
Merge pull request #2569 from EnterpriseDB/release/2022-04-20
Browse files Browse the repository at this point in the history
Release: 2022-04-20
  • Loading branch information
drothery-edb authored Apr 20, 2022
2 parents fa6e604 + f4d23f7 commit 01ff6fa
Show file tree
Hide file tree
Showing 68 changed files with 40 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "Version 42.3.3.1"

---

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.3.3.1` include:

| Type | Description |
| -------------- | ------------------------------------------------------------------------------- |
| Upstream Merge | Merged with the upstream community driver version `42.3.3`. See the community [JDBC documentation](https://jdbc.postgresql.org/documentation/changelog.html#version_42.3.3) for details. |
| Security Fix | [GHSA-673j-qm5f-xpv8](https://github.com/advisories/GHSA-673j-qm5f-xpv8): Removed the loggerFile and loggerLevel configuration properties as part of this fix. While the properties still exist, they can no longer be used to configure the driver logging. Instead use java.util.logging configuration mechanisms such as `logging.properties`. |
| Change | As part of security fix GHSA-673j-qm5f-xpv, the ability to enable logging using the connection properties is no longer available as of version 42.3.3. | |



Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ These release notes describe what's new in each release. When a minor or patch r

| Version | Release Date |
| ---------------------------------------- | ------------ |
| [42.3.3.1](08_jdbc_42.3.3.1_rel_notes) | 2022 Apr 20 |
| [42.3.2.1](09_jdbc_42.3.2.1_rel_notes) | 2022 Feb 15 |
| [42.2.24.1](10_jdbc_42.2.24.1_rel_notes) | 2021 Nov 5 |
| [42.2.19.1](12_jdbc_42.2.19.1_rel_notes) | 2021 Apr 15 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Some of the additional connection properties are shown in the following table.
| user | String | The database user on whose behalf the connection is being made. |
| password | String | The database user’s password. |
| ssl | Boolean | Requests an authenticated, encrypted SSL connection. |
| loggerLevel | String | The logger level of the driver. The allowed values are `OFF`, `DEBUG`, or `TRACE`. This enables the `java.util.logging.Logger` level of the driver based on the following mapping of levels: `DEBUG` -> `FINE`, `TRACE` -> `FINEST`. The `loggerLevel` property is intended for debugging the driver and not for general SQL query debugging. |
| loggerFile | String | The file name output of the logger. This parameter must be used together with `loggerLevel`. If set, the logger uses a `java.util.logging.FileHandler` to write to a specified file. If the parameter isn't set or the file can’t be created, the `java.util.logging.ConsoleHandler` is used instead of `java.util.logging.FileHandler`. |
| charSet | String | The value of `charSet` determines the character set used for data sent to or received from the database. |
| prepareThreshold | Integer | The value of `prepareThreshold` determines the number of `PreparedStatement` executions required before switching to server-side prepared statements. The default is five. |
| loadBalanceHosts | Boolean | In default mode (disabled) hosts are connected in the given order. If enabled, hosts are chosen randomly from the set of suitable candidates. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,30 @@ Use the `registerOutParameter` method to identify each `OUT` or `INOUT` paramete
The following examples show using the `CallableStatement` method to provide parameters to a procedure with the following signature:

```text
PROCEDURE hire_emp (ename VARCHAR2
empno NUMBER
job VARCHAR2
sal NUMBER
CREATE OR REPLACE PROCEDURE hire_emp (ename VARCHAR2
empno NUMBER,
job VARCHAR2,
sal NUMBER,
hiredate DATE DEFAULT now(),
mgr NUMBER DEFAULT 7100,
deptno NUMBER
)
IS
BEGIN
INSERT INTO emp VALUES (empno, ename, job, mgr, hiredate, sal, deptno);
END;
```

The following example uses ordinal notation to provide parameters:

```text
CallableStatement cstmt = con.prepareCall
("{CALL hire_emp(?,?,?,?,?,?,?)}");
CallableStatement cstmt = con.prepareCall("{CALL hire_emp(?,?,?,?,?,?,?)}");
//Bind a value to each parameter.
cstmt.setString(1, "SMITH");
cstmt.setInt(2, 8888);
cstmt.setString(3, "Sales");
cstmt.setInt(4, 5500);
cstmt.setDate(5, "2016-06-01");
cstmt.setDate(5, Date.valueOf("2016-06-01"));
cstmt.setInt(6, 7566);
cstmt.setInt(7, 30);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ The stored procedure shown in the following (`getEmpNames`) builds two `REF CURS
```text
CREATE OR REPLACE PROCEDURE getEmpNames
(
commissioned IN OUT SYS_REFCURSOR,
salaried IN OUT SYS_REFCURSOR
commissioned OUT SYS_REFCURSOR,
salaried OUT SYS_REFCURSOR
)
IS
BEGIN
Expand Down Expand Up @@ -82,7 +82,7 @@ public void RefCursorSample(Connection con)
}
```

A `CallableStatement` prepares each `REF CURSOR` (`commissioned` and `salaried`). Each cursor is returned as an `IN OUT` parameter of the stored procedure, `getEmpNames()`:
A `CallableStatement` prepares each `REF CURSOR` (`commissioned` and `salaried`). Each cursor is returned as an `OUT` parameter of the stored procedure, `getEmpNames()`:

```text
String commandText = "{call getEmpNames(?,?)}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,13 @@ The EDB Postgres Advanced Server JDBC Connector supports the use of logging to h
!!! Note
Previous versions of the EDB Postgres Advanced Server JDBC Connector used a custom mechanism to enable logging. It's now replaced by the use of `java.util.logging` in versions moving forward from community version 42.1.4.1. The older mechanism is no longer available.

## Enabling logging with connection properties (static)
Previous versions of the Advanced Server JDBC Connector can enable logging using the connection properties, however it is no longer available from 42.3.3 onwards.

You can directly configure logging within the connection properties of the JDBC Connector. The connection properties related to logging are `loggerLevel` and `loggerFile`.

`loggerLevel`
## Enabling logging with logging.properties

Logger level of the driver. Allowed values are `OFF`, `DEBUG`, or `TRACE`. This option enables the `java.util.logging.Logger` level of the driver to correspond to the following EDB Postgres Advanced Server JDBC levels:
The default Java logging framework stores its configuration in a file called `logging.properties`. You can use logging properties to configure the driver dynamically (for example, when using the JDBC Connector with an application server such as Tomcat, JBoss, WildFly, etc.), which makes it easier to enable/disable logging at runtime. The following example demonstrates configuring logging dynamically:

| loggerLevel | java.util.logging |
| ----------- | ----------------- |
| OFF | OFF |
| DEBUG | FINE |
| TRACE | FINEST |

`loggerFile`

File name output of the logger. The default is `java.util.logging.ConsoleHandler`. The following example sets the logging level to `TRACE (FINEST)` and the log file `to EDB-JDBC.LOG`:

`jdbc:edb://myhost:5444/mydb?loggerLevel=TRACE&loggerFile=EDB-JDBC.LOG`

## Enabling logging with logging.properties (dynamic)

You can use logging properties to configure the driver dynamically (for example, when using the JDBC Connector with an application server such as Tomcat, JBoss, WildFly, etc.), which makes it easier to enable/disable logging at runtime. The following example shows configuring logging dynamically:

```text
handlers = java.util.logging.FileHandler
Expand All @@ -50,7 +34,10 @@ The default file output is in the user’s home directory:
java.util.logging.FileHandler.pattern = %h/EDB-JDBC%u.log
java.util.logging.FileHandler.limit = 5000000
java.util.logging.FileHandler.count = 20
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.FileHandler.level = FINEST java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n
java.util.logging.FileHandler.formatter =
java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = FINEST
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n
```

Use the following command to set the logging level for the JDBC Connector to `FINEST` (maps to `loggerLevel`):
Expand Down
2 changes: 2 additions & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
/docs/jdbc_connector/42.2.12.3/* /docs/jdbc_connector/latest/:splat 301
/docs/jdbc_connector/42.2.19.1/* /docs/jdbc_connector/latest/:splat 301
/docs/jdbc_connector/42.2.24.1/* /docs/jdbc_connector/latest/:splat 301
/docs/jdbc_connector/42.2.24.1/* /docs/jdbc_connector/latest/:splat 301
/docs/jdbc_connector/42.3.2.1/* /docs/jdbc_connector/latest/:splat 301

# ODBC Connector
# collapsed versions
Expand Down

0 comments on commit 01ff6fa

Please sign in to comment.