◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ env:
- UTPLSQL_VERSION="v3.1.3"
- UTPLSQL_VERSION="v3.1.6"
- UTPLSQL_VERSION="v3.1.7"
- UTPLSQL_VERSION="develop"
UTPLSQL_FILE="utPLSQL"

matrix:
include:
- env: UTPLSQL_VERSION="v3.1.7"
jdk: openjdk9
- env: UTPLSQL_VERSION="v3.1.7"
jdk: openjdk10
- env: UTPLSQL_VERSION="v3.1.7"
jdk: openjdk11
- env: UTPLSQL_VERSION="v3.1.7"
jdk: openjdk12
- env: UTPLSQL_VERSION="v3.1.7"
jdk: openjdk13

before_cache:
14 changes: 0 additions & 14 deletions .travis/maven_cfg.sh
45 changes: 42 additions & 3 deletions src/main/java/org/utplsql/api/db/DynamicParameterList.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public class DynamicParameterList {

interface DynamicParameter {
void setParam( CallableStatement statement, int index ) throws SQLException;
}

private DynamicParameterList(LinkedHashMap<String, DynamicParameter> params) {
@@ -33,8 +37,8 @@ private DynamicParameterList(LinkedHashMap<String, DynamicParameter> params) {
* @return comma-separated list of parameter identifiers
*/
public String getSql() {
return params.keySet().stream()
.map(e -> e + " => ?")
.collect(Collectors.joining(", "));
}

Expand Down Expand Up @@ -115,6 +119,18 @@ public DynamicParameterListBuilder addIfNotEmpty(String identifier, Object[] val
return this;
}

public DynamicParameterList build() {
return new DynamicParameterList(params);
}
Expand Up @@ -155,6 +171,28 @@ public void setParam(CallableStatement statement, int index) throws SQLException
}
}

private static class DynamicArrayParameter implements DynamicParameter {
private final Object[] value;
private final String customTypeName;
Expand All @@ -172,7 +210,8 @@ public void setParam(CallableStatement statement, int index) throws SQLException
statement.setNull(index, Types.ARRAY, customTypeName);
} else {
statement.setArray(
index, oraConnection.createOracleArray(customTypeName, value)
);
}
}
Expand Down
Loading
Toggle all file notes Toggle all file annotations