public inbox for [email protected]
help / color / mirror / Atom feedFrom: Laurenz Albe <[email protected]>
To: [email protected]
To: [email protected]
Cc: [email protected]
Subject: Fwd: PostgreSQL JDBC 42.7.5 returns an unexpected catalog name
Date: Sat, 29 Mar 2025 17:21:09 +0100
Message-ID: <[email protected]> (raw)
References: <DM6PR15MB4107ADBFB245342C6A6AA03FB4A02@DM6PR15MB4107.namprd15.prod.outlook.com>
I think this belongs here.
-------- Forwarded Message --------
From: Vinhson Nguyen <[email protected]>
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
1) Problem Description:
When upgrading our application to a new PostgreSQL JDBC driver 42.7.5 (from 42.7.4), we got an expected catalog name in the result set returned by DatabaseMetadata.getSchemas().
Expected catalog name: null (42.7.4)
Unexpected catalog name: dbcert (42.7.5)
2) Connection Info:
URL used:
jdbc:postgresql://cteds721.fyre.ibm.com:54172/dbcert
Driver name/Version:
org.postgresql.Driver/postgresql-42.7.5.jar
userID/pw: dbcert1/***********
3) Attachements:
a) PG_JDBC_42_7_4.PNG: Screenshot showing an expected catalog name (null) with driver version 42.7.4.
b) PG_JDBC_42_7_5.PNG: Screenshot showing an unexpected catalog name (dbcert) with driver version 42.7.5.
c) ImportTest.java: Java test program used in (a) and (b).
If you need any additional details, please let me know.
Thank you in advance!
Vinhson Nguyen
Attachments:
[text/x-java] ImportTest.java (1.9K, 2-ImportTest.java)
download | inline:
package TD;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ImportTest {
public static void main(String[] args) {
System.out.println("\nStarting main ImportTest... ");
FileWriter fw = null;
String outputFileName = "C:\\temp\\mdOutput.txt";
try {
fw = new FileWriter(outputFileName, false);
} catch (IOException e) {
System.out.println(e);
}
Connection conn = null;
conn = connectDB();
// Processing metadata
try {
DatabaseMetaData dmd = conn.getMetaData();
System.out.println("\ngetDriverName = " + dmd.getDriverName());
System.out.println("\ngetDriverVersion = " + dmd.getDriverVersion());
System.out.println("\ngetDatabaseProductName = " + dmd.getDatabaseProductName());
System.out.println("\ngetDatabaseProductVersion = " + dmd.getDatabaseProductVersion());
ResultSet schemas = dmd.getSchemas();
while (schemas.next()) {
String schemaName = schemas.getString(1);
String catName = schemas.getString(2);
System.out.println("\ncatalog = " + catName + " schema = " + schemaName);
}
} catch (SQLException e) {
System.out.println(e);
}
try {
conn.close();
} catch (SQLException e) {
System.out.println(e);
}
try {
fw.close();
} catch (IOException ioe) {
System.out.println(ioe);
}
System.out.println("\nEnding main ImportTest...");
}
public static Connection connectDB() {
Connection tdCon = null;
try {
Class.forName("org.postgresql.Driver");
String url = "jdbc:postgresql://cteds721.fyre.ibm.com:54172/dbcert";
String userID = "dbcert1";
String pw = "Cognos_1";
tdCon = DriverManager.getConnection(url, userID, pw);
} catch (SQLException eSQL) {
System.out.println(eSQL);
} catch (Exception eClassNotFound) {
System.out.println(eClassNotFound);
}
return tdCon;
}
}
[image/png] PG_JDBC_42_7_4.PNG (166.3K, 3-PG_JDBC_42_7_4.PNG)
download | view image
[image/png] PG_JDBC_42_7_5.PNG (167.9K, 4-PG_JDBC_42_7_5.PNG)
download | view image
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Fwd: PostgreSQL JDBC 42.7.5 returns an unexpected catalog name
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox