Skip to content

Commit a58e1ce

Browse files
committed
Force parser=pkl
1 parent 0cb8559 commit a58e1ce

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ojdbc-provider-pkl/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ To use the Oracle JDBC Pkl Parser:
2727

2828
1. Prepare a .pkl configuration file (see examples below).
2929
2. Add this artifact to your application's classpath.
30-
3. Reference the .pkl file in the JDBC URL.
30+
3. Reference the .pkl file and the parser type in the JDBC URL.
3131

32-
The parser type is inferred from the file extension. In this case, it’s "pkl".
33-
If the file name doesn’t include an extension, you can specify the parser explicitly using the parser option.
32+
The parser type can be specified using the `parser` option. In this case, it’s "parser=pkl".
33+
By default, the parser type is "json".
3434
All other options (like key, label, etc.) follow the same format as other providers.
3535

3636
Example using the file configuration provider:
3737

3838
```java
39-
jdbc:oracle:thin:@config-file://{pkl-file-name}[?parser=pkl&key=prefix&label=value&option1=value1&option2=value2...]
39+
jdbc:oracle:thin:@config-file://{pkl-file-name}?parser=pkl[&key=prefix&label=value&option1=value1&option2=value2...]
4040
```
4141

4242
## Writing .pkl Configuration
@@ -70,7 +70,7 @@ jdbc {
7070
#### URL (using file provider):
7171

7272
```java
73-
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl
73+
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl
7474
```
7575

7676
### 2. Using `import`
@@ -103,5 +103,5 @@ config1 = (JdbcConfig) {
103103
#### URL (using file provider):
104104

105105
```java
106-
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?key=config1
106+
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl&key=config1
107107
```

ojdbc-provider-pkl/src/test/java/oracle/jdbc/provider/pkl/configuration/PklParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void testPkl() throws Exception {
101101
final String location = file.getAbsolutePath();
102102

103103
Properties properties = PROVIDER
104-
.getConnectionProperties(location);
104+
.getConnectionProperties(location + "?parser=pkl");
105105

106106

107107
assertTrue(properties.containsKey("URL"), "Should contain property URL");

ojdbc-provider-samples/src/main/java/oracle/jdbc/provider/pkl/configuration/PklExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class PklExample {
5858
public static void main(String[] args) throws SQLException {
5959
// Sample default URL if non present
6060
if (args.length == 0) {
61-
url = "jdbc:oracle:thin:@config-file://myJdbcConfig.pkl";
61+
url = "jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl";
6262
} else {
6363
url = args[0];
6464
}

0 commit comments

Comments
 (0)