Troubleshooting
Problem
JDBC specification says wildcard character underscore "_" can be used as a substitute for any single character in input values in DatabaseMetaData#getTables method. When IBM JDBC driver V3.1.202304260937 or earlier version is used in a Java application to obtain a list of Virtual Tables with getTables method, it does not respect the wildcard. The same also applies to getColumns method.
Symptom
The following are two examples:
Assuming that the following Virtual Table is defined in a DVM server:
Assuming that the following Virtual Table is defined in a DVM server:
DVSQL.DB2_Q_ORG
// Example 1. Using _ to substitute character '2' like this: DVSQL.DB_\\_Q\\_ORG table.
assertEquals("\\", conn.getMetaData().getSearchStringEscape());
rs = con.getMetaData().getTables(null, "DVSQL", "DB_\\_Q\\_ORG", new String[] {"TABLE", "VIEW", "ALIAS"});
assertEquals(false, rs.next());
// Example 2. Using escape character '\' to escape underscore character '_' like this: DVSQL.DB2\\_Q\\_ORG table.
assertEquals("\\", con.getMetaData().getSearchStringEscape());
rs = con.getMetaData().getTables(null, "DVSQL", "DB2\\_Q\\_ORG", new String[] {"TABLE", "VIEW", "ALIAS"});
assertEquals(false, rs.next());
One row of result set is expected but empty result set is returned.
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS4NKG","label":"IBM Data Virtualization Manager for z\/OS"},"ARM Category":[{"code":"a8m3p000000LRcBAAW","label":"JDBC"},{"code":"a8m0z000000cxATAAY","label":"Studio"}],"ARM Case Number":"TS013336016","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"},{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSKRKK","label":"IBM Db2 Analytics Accelerator Loader for z\/OS"},"ARM Category":[{"code":"a8m0z000000cxHtAAI","label":"DB2 Analytics Accelerator Loader Server"}],"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions"},{"Type":"MASTER","Line of Business":{"code":"LOB70","label":"Z TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS3H8V","label":"IBM Open Data Analytics for z\/OS"},"ARM Category":[{"code":"a8m0z000000cxHeAAI","label":"IBM z\/OS Mainframe Data Service for Apache Spark"}],"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions"},{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS6QWT","label":"IBM QMF Analytics for Multiplatforms"},"ARM Category":[{"code":"a8m0z000000cxH0AAI","label":"QMF Data Service"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
Modified date:
16 February 2024
UID
ibm17113391