Skip to content

Commit 588a017

Browse files
committed
Finalize jdp-2025-06
1 parent e37afa1 commit 588a017

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

devdoc/jdp/jdp-2025-06-schema-support.adoc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
== Status
77

8-
* Draft
9-
* Proposed for: Jaybird 7, potential partial backport to Jaybird 5
8+
* Published: 2025-11-04
9+
* Implemented in: Jaybird 7
1010

1111
== Type
1212

@@ -52,11 +52,6 @@ JDBC defines various methods, parameters, and return values or result set column
5252

5353
Jaybird 5 is the "`long-term support`" version for Java 8.
5454

55-
[NOTE]
56-
====
57-
This document is in flux, and will be updated during implementation of the feature.
58-
====
59-
6055
== Decision
6156

6257
Jaybird 7 will implement schema support for Firebird 6.0.
@@ -67,8 +62,8 @@ Further details can be found in <<consequences>>.
6762
Schema support will _not_ be backported to Jaybird 6 as the required changes are simply too large.
6863
It would mean that Jaybird 6 would contain most of Jaybird 7, and upgrading to a -- theoretical -- Jaybird 6.1 would have similar risks and compatibility issues as upgrading to Jaybird 7.
6964

70-
Decision on a (partial) backport to Jaybird 5 -- as the "`long-term support`" version for Java 8 -- is still pending (e.g. as a Jaybird 5.1.x), and may be the subject of a separate JDP.
71-
We might only do that on demand and/or when someone is willing to sponsor the work.
65+
Decision on a (partial) backport to Jaybird 5 -- as the "`long-term support`" version for Java 8 -- is pending (e.g. as a Jaybird 5.1.x), and if so, will be the subject of a separate JDP.
66+
We will only do that on demand and if someone is willing to sponsor the work.
7267

7368
[#consequences]
7469
== Consequences
@@ -97,9 +92,11 @@ Jaybird cannot honour this requirement for plain `Statement`, as schema resoluti
9792
** Include schema names in joins to ensure matching the right objects
9893
** Allow searching for schema or schema pattern as specified in JDBC, or were needed for internal metadata queries
9994
** `getCatalogs`;
100-
it is not possible to identify the schema(s) within the confines of JDBC.
95+
we currently use this to report package names if `useCatalogAsPackage=true`.
96+
It is not possible to identify the schema(s) of a package within the confines of JDBC.
10197
+
10298
We considered adding a column that lists the schema(s) that contain the package name, but we don't think it will see use in practice.
99+
If there is demand, this decision may be revisited.
103100
* `FirebirdConnection`
104101
** Added method `String getSearchPath()` to obtain the search path as reported by `RBB$GET_CONTEXT('SYSTEM', 'SEARCH_PATH')`, or `null` if schemas are not supported
105102
** Added method `List<String> getSearchPathList()` to obtain the search path as a list of unquoted object names, or empty list if schemas are not supported
@@ -111,10 +108,10 @@ We considered adding a column that lists the schema(s) that contain the package
111108
this fulfills the JDBC requirements that a `CallableStatement` is not sensitive to current schema changes, but only *if* Jaybird is able to identify the procedure, behaviour is undefined if the procedure was not found.
112109
** The API of `StoredProcedureMetaData` (internal API) is changed to not report selectability, but to update the `FBProcedureCall` instance with selectability and other information, like identified schema and/or package.
113110
** For qualified *and* unambiguous procedure reference, the selectability is cached *per connection*, for unqualified or ambiguous procedure reference, the lookup is performed on each `Connection.prepareCall`, to account for search path changes
114-
** Support for packages was missing in the handling of callable statements, and is added, also for older versions
111+
** Support for packages was missing in the handling of callable statements, and is added, also for older Firebird versions
115112
* Effects for management API
116113
** `StatisticsManager`
117-
*** `getTableStatistics` received an overload to also accept a list of schemas (`sts_schema`)
114+
*** `getTableStatistics` received an overload to also accept a collection of schemas (`sts_schema`)
118115
** `FBTableStatisticsManager`/`TableStatistics`
119116
*** Internally `ObjectReference` is used for the table instead of a String
120117
*** The key of the map returned by `getTableStatistics()` is a qualified table reference (i.e. `{<table-name> | <quoted-schema>.<quoted-table-name>}`.
@@ -124,7 +121,7 @@ For schemaless tables, the unquoted table name is used as the key for backwards
124121
**** `tableReference()` with the qualified table reference (i.e. `[<quoted-schema>.]<quoted-table-name>` (contrary to the key of getTableStatistics, it's always quoted!))
125122
* TODO: Add information to Jaybird manual
126123

127-
Note to self: use `// TODO Add schema support` in places that you identify need to get/improve schema support, while working on schema support elsewhere
124+
// Note to self: use `// TODO Add schema support` in places that you identify need to get/improve schema support, while working on schema support elsewhere
128125

129126
[appendix]
130127
== License Notice

src/docs/asciidoc/release_notes.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ If `SYSTEM` is not included, the server will automatically add it as the last sc
529529
use `null` or -- `schemaPattern` only -- `"%"` to match all schemas
530530
** `getCatalogs` -- when `useCatalogAsPackage=true` -- returns all (distinct) package names over all schemas.
531531
Within the limitations and specification of the JDBC API, this method cannot be used to find out which schema(s) contain a specific package name.
532-
// TODO Maybe add a custom column with a list of schema names?
533532
** `getColumnPrivileges` and `getTablePrivileges` received an additional column, `JB_GRANTEE_SCHEMA`, which is non-``null`` for grantees that are schema-bound (e.g. procedures).
534533
+
535534
As this is a non-standard column, we recommend to always retrieve it by name.
@@ -559,15 +558,22 @@ we recommend to always use `null` for `catalog`
559558
* `ResultSetMetaData`
560559
** `getSchemaName` reports the schema if the column is backed by a table, otherwise empty string (`""`)
561560
* `FirebirdConnection`/`FBConnection`
561+
** `setSchema` will modify the search path by prepending the specified schema, or -- if `setSchema` was called previously -- replacing the previous value set.
562+
+
563+
The schema is not checked for existence, and setting one will not result in an exception, see also note about `getSchema` below.
564+
** `getSchema()` reports the value of `CURRENT_SCHEMA`, which is the first valid (i.e. existing) schema on the search path.
565+
+
566+
The value reported can change if a previously missing schema is created in the database.
562567
** Added method `String getSearchPath()` to obtain the search path as reported by `RBB$GET_CONTEXT('SYSTEM', 'SEARCH_PATH')`, or `null` if schemas are not supported
563568
** Added method `List<String> getSearchPatList()` to obtain the search path as a list of unquoted object names, or empty list if schemas are not supported
564569
** Added methods `setSearchPath(String)` and `setSearchPathList(String...)/(List<String>)` to set the search path;
565570
these methods throw `SQLFeatureNotSupportedException` if schemas are not supported.
566571
* `StatisticsManager`
567572
** `getTableStatistics`
568573
*** `getTableStatistics(String[] tableNames)` was changed to accept varargs (`getTableStatistics(String... tableNames)`)
569-
*** Added overload `getTableStatistics(List<String> tableNames)` with same behaviour as `getTableStatistics(String... tableNames)`
570-
*** Added overload `getTableStatistics(List<String> schemas, List<String> tableNames)` -- if `schemas` is non-empty, on Firebird 6.0 and higher, it will restrict the search for tables to the specified schemas
574+
*** Added overload `getTableStatistics(Collection<String> tableNames)` with same behaviour as `getTableStatistics(String... tableNames)`
575+
*** Added overload `getTableStatistics(Collection<String> schemas, Collection<String> tableNames)` -- if `schemas` is non-empty, on Firebird 6.0 and higher, it will restrict the search for tables to the specified schemas;
576+
if `tableNames` is empty, and `schemas` is not, only the tables of the specified schemas will be reported
571577
* `FBTableStatisticsManager` (experimental feature)
572578
** For schema-bound tables, the key of the map returned by `getTableStatistics()` is a fully qualified and quoted table reference (i.e. `<quoted-schema>.<quoted-table-name>`).
573579
For schemaless tables (Firebird 5.0 and older, or tables that were not found), the key is still the unquoted `<table-name>`.

0 commit comments

Comments
 (0)