Skip to content

Commit

Permalink
Merge pull request #774 from kaneeldias/fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneeldias authored Sep 8, 2023
2 parents b15e6c4 + 2f0e498 commit 6dab206
Showing 1 changed file with 7 additions and 42 deletions.
49 changes: 7 additions & 42 deletions examples/online-shop/Working with an Oracle Database.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,18 @@ These are HTTP RESTful services used to insert, create, and retrieve data of a s

## Prerequisite

* *Adding the oracledb JDBC thin driver and their dependencies*
### Initial schema, table creation, and data insertion

* Download and add the OracleDB thin driver `ojdbc11.jar` along with the `xdb.jar` and `xmlparserv2.jar` files as native
library dependencies in the example Ballerina project's `Ballerina.toml` file. It is recommended to use an Oracle
thin driver `ojdbc11.jar` version greater than 21.1.0.0. As per the existing `Ballerina.toml` file, it points to
those dependencies in the `ballerina` folder. You may have to download those dependencies and update the `Ballerina.toml`
file.

Follow one of the ways below to add the JAR in the file:

* Download the JAR files and update the path.
```
[[platform.java17.dependency]]
path = "PATH"
```
or

* Add the JAR with the Maven dependency params.
```
[platform.java17.dependency]]
groupId = "com.oracle.database.jdbc"
artifactId = "ojdbc11"
version = "21.1.0.0"
* Start and run the Oracle database Docker container or standalone database.

[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xdb"
version = "21.1.0.0"
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xmlparserv2"
version = "21.1.0.0"
```

* *Initial schema, table creation, and data insertion*

* Start and run the Oracle database Docker container or standalone database.

* Run the `schema_with_data.sql` script against the Oracle database.
* Navigate to the `setup` folder of the `examples/onlineshop` directory, and open the `schema_with_data.sql` file.
* Run the content of the file in the Oracle database.
* Run the `schema_with_data.sql` script against the Oracle database.
* Navigate to the `setup` folder of the `examples/onlineshop` directory, and open the `schema_with_data.sql` file.
* Run the content of the file in the Oracle database.

## Run the Example
To start the service, navigate to the `examples/onlineshop` folder, and execute the command below.
It will build the posts of the Ballerina project and then run it.

```
$bal run
```shell
bal run
```

0 comments on commit 6dab206

Please sign in to comment.