Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ojdbc-provider-pkl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ To use the Oracle JDBC Pkl Parser:

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

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

Example using the file configuration provider:

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

## Writing .pkl Configuration
Expand Down Expand Up @@ -70,7 +70,7 @@ jdbc {
#### URL (using file provider):

```java
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl
```

### 2. Using `import`
Expand Down Expand Up @@ -103,5 +103,5 @@ config1 = (JdbcConfig) {
#### URL (using file provider):

```java
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?key=config1
jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl&key=config1
```
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void testPkl() throws Exception {
final String location = file.getAbsolutePath();

Properties properties = PROVIDER
.getConnectionProperties(location);
.getConnectionProperties(location + "?parser=pkl");


assertTrue(properties.containsKey("URL"), "Should contain property URL");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class PklExample {
public static void main(String[] args) throws SQLException {
// Sample default URL if non present
if (args.length == 0) {
url = "jdbc:oracle:thin:@config-file://myJdbcConfig.pkl";
url = "jdbc:oracle:thin:@config-file://myJdbcConfig.pkl?parser=pkl";
} else {
url = args[0];
}
Expand Down