Skip to content

Commit 56c655f

Browse files
committed
#343 Define callableImplementation connection property
1 parent 50923e8 commit 56c655f

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

src/main/org/firebirdsql/ds/AbstractConnectionPropertiesDataSource.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,16 @@ public void setEscapeProcessing(boolean escapeProcessing) {
551551
FirebirdConnectionProperties.super.setEscapeProcessing(escapeProcessing);
552552
}
553553

554+
@Override
555+
public String getCallableImplementation() {
556+
return FirebirdConnectionProperties.super.getCallableImplementation();
557+
}
558+
559+
@Override
560+
public void setCallableImplementation(String callableImplementation) {
561+
FirebirdConnectionProperties.super.setCallableImplementation(callableImplementation);
562+
}
563+
554564
@SuppressWarnings("deprecation")
555565
@Deprecated(since = "5")
556566
@Override

src/main/org/firebirdsql/jaybird/props/DatabaseConnectionProperties.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,4 +893,42 @@ default void setEscapeProcessing(boolean escapeProcessing) {
893893
setBooleanProperty(PropertyNames.escapeProcessing, escapeProcessing);
894894
}
895895

896+
/**
897+
* @return the callable statement implementation version
898+
* @see #setCallableImplementation(String)
899+
* @since 7
900+
*/
901+
default String getCallableImplementation() {
902+
return getProperty(PropertyNames.callableImplementation, PropertyConstants.DEFAULT_CALLABLE_IMPLEMENTATION);
903+
}
904+
905+
/**
906+
* Configures the callable statement version.
907+
* <p>
908+
* Currently supported callable statement versions are:
909+
* </p>
910+
* <ul>
911+
* <li>{@code V1} &mdash; the first (original) callable statement implementation (default), basically
912+
* the implementation available since Jaybird 1 (with some evolution since then)</li>
913+
* <li>{@code V2} &mdash; the second callable statement implementation, introduced in Jaybird 7 (currently
914+
* experimental)</li>
915+
* </ul>
916+
* <p>
917+
* In Jaybird 7, the {@code V2} implementation is experimental. It can be enabled for evaluation/testing. A future
918+
* point release of Jaybird 7 may declare it stable. V2 is expected to become the default in Jaybird 8. Once V2 is
919+
* the default, we will likely remove V1 support in Jaybird 9 or later (or at minimum, at least one version after V2
920+
* becomes the default).
921+
* </p>
922+
* <p>
923+
* For more information also see (TODO Add link the JDP and Jaybird manual)
924+
* </p>
925+
*
926+
* @param callableImplementation
927+
* callable statement version, {@code V1} (default) or {@code v2} (experimental) (case-insensitive)
928+
* @since 7
929+
*/
930+
default void setCallableImplementation(String callableImplementation) {
931+
setProperty(PropertyNames.callableImplementation, callableImplementation);
932+
}
933+
896934
}

src/main/org/firebirdsql/jaybird/props/PropertyConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public final class PropertyConstants {
7373
public static final String DEFAULT_AUTH_PLUGINS = "Srp256,Srp";
7474
static final String DEFAULT_LEGACY_AUTH_CHARSET = "UTF-8";
7575

76+
public static final String CALLABLE_IMPLEMENTATION_V1 = "V1";
77+
public static final String CALLABLE_IMPLEMENTATION_V2 = "V2";
78+
static final String DEFAULT_CALLABLE_IMPLEMENTATION = CALLABLE_IMPLEMENTATION_V1;
79+
7680
private PropertyConstants() {
7781
// no instances
7882
}

src/main/org/firebirdsql/jaybird/props/PropertyNames.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public final class PropertyNames {
7272
public static final String maxBlobCacheSize = "maxBlobCacheSize";
7373
public static final String searchPath = "searchPath";
7474
public static final String escapeProcessing = "escapeProcessing";
75+
// TODO Maybe use a shorter name or add a shorter alias?
76+
public static final String callableImplementation = "callableImplementation";
7577

7678
// service connection
7779
public static final String expectedDb = "expectedDb";

src/main/org/firebirdsql/jaybird/props/internal/StandardConnectionPropertyDefiner.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public Stream<ConnectionProperty> defineProperties() {
108108
.dpbItem(isc_dpb_max_blob_cache_size),
109109
builder(searchPath).aliases("search_path", "isc_dpb_search_path").dpbItem(isc_dpb_search_path),
110110
builder(escapeProcessing).type(BOOLEAN),
111+
// TODO Maybe use a shorter name or add a shorter alias?
112+
builder(callableImplementation).choices(CALLABLE_IMPLEMENTATION_V1, CALLABLE_IMPLEMENTATION_V2),
111113

112114
// TODO Consider removing this property, otherwise formally add it to PropertyNames
113115
builder("filename_charset"),

0 commit comments

Comments
 (0)