{"id":23338266,"url":"https://github.com/abhirockzz/fn-oracledb-java-workshop","last_synced_at":"2026-04-27T01:31:40.546Z","repository":{"id":79124994,"uuid":"146683316","full_name":"abhirockzz/fn-oracledb-java-workshop","owner":"abhirockzz","description":"Fn functions invoking Oracle Database","archived":false,"fork":false,"pushed_at":"2018-09-05T13:48:17.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-01T14:52:32.732Z","etag":null,"topics":["docker","faas","fnproject","functions","oracle-database","serverless","workshop"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhirockzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-30T02:14:23.000Z","updated_at":"2018-09-05T13:48:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"744d2193-aacd-415c-9e89-b782336afa8e","html_url":"https://github.com/abhirockzz/fn-oracledb-java-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhirockzz/fn-oracledb-java-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-oracledb-java-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-oracledb-java-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-oracledb-java-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-oracledb-java-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/fn-oracledb-java-workshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Ffn-oracledb-java-workshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32319559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","faas","fnproject","functions","oracle-database","serverless","workshop"],"created_at":"2024-12-21T03:13:25.926Z","updated_at":"2026-04-27T01:31:40.529Z","avatar_url":"https://github.com/abhirockzz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fn with Oracle DB\r\n\r\nFn functions executing `CRUD` operations on Oracle DB. This sample uses a simple `Employee` entity for demonstration purposes \r\n\r\n\u003e For the purposes of this lab, an [Oracle Database instance on Oracle Cloud Infrastructure](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm?tocpath=Services%7CDatabase%7C_____0) has already been provisioned for you along with the associated schema and table\r\n\r\nAs you make your way through the tutorials, look out for this icon ![](images/userinput.png) Whenever you see it, it's time for you to perform an action\r\n\r\n## Setup\r\n\r\n### Build the (base) Docker image containing Oracle JDBC driver\r\n\r\n- Clone or download this repo\r\n- download the Oracle JDBC driver from [this link](https://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html) (`ojdbc7.jar` should be fine) and copy it to the `oracle_driver_docker` folder\r\n- Build a Docker image with the driver JAR (You will use an existing Dockerfile)\r\n\t  \r\n\t![](images/userinput.png)\r\n\t\u003e```\r\n\t\u003e cd fn-oracledb-java-workshop/oracle_driver_docker\r\n\t\u003e```\t\r\n\r\n\tStart Docker on your machine\r\n\t\r\n\t![](images/userinput.png)\r\n\t\u003e```\r\n\t\u003e docker build -t oracle_jdbc_driver_docker .\r\n\t\u003e```\r\n\t \r\n\t(if you choose to change the name of the image i.e. `oracle_jdbc_driver_docker`, you'll need to update those references in the `build_image` section of the `func.yaml` for all the functions)\r\n\r\n(if successful) You should see an output as below\r\n\r\n\tSending build context to Docker daemon  3.401MB\r\n\tStep 1/3 : FROM fnproject/fn-java-fdk-build:jdk9-1.0.63\r\n\t ---\u003e 973847bef180\r\n\tStep 2/3 : COPY ojdbc7.jar .\r\n\t ---\u003e dd9005799e07\r\n\tStep 3/3 : RUN mvn deploy:deploy-file -Durl=file:///function/repo -Dfile=ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.1 -Dpackaging=jar\r\n\t ---\u003e Running in 94bce78bf6bb\r\n\t[INFO] Scanning for projects...\r\n\tDownloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom\r\n\tDownloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 1.6 kB/s)\r\n\t\r\n\t............ skipping all the maven magic ..............\r\n\t\r\n\tUploading to remote-repository: file:///function/repo/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar\r\n\tUploaded to remote-repository: file:///function/repo/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar (3.4 MB at 6.3 MB/s)\r\n\tUploading to remote-repository: file:///function/repo/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom\r\n\tUploaded to remote-repository: file:///function/repo/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom (392 B at 49 kB/s)\r\n\tDownloading from remote-repository: file:///function/repo/com/oracle/ojdbc7/maven-metadata.xml\r\n\tUploading to remote-repository: file:///function/repo/com/oracle/ojdbc7/maven-metadata.xml\r\n\tUploaded to remote-repository: file:///function/repo/com/oracle/ojdbc7/maven-metadata.xml (302 B at 22 kB/s)\r\n\t[INFO] ------------------------------------------------------------------------\r\n\t[INFO] BUILD SUCCESS\r\n\t[INFO] ------------------------------------------------------------------------\r\n\t[INFO] Total time: 27.221 s\r\n\t[INFO] Finished at: 2018-08-30T02:08:09Z\r\n\t[INFO] ------------------------------------------------------------------------\r\n\tRemoving intermediate container 94bce78bf6bb\r\n\t ---\u003e fc46eb9cc4de\r\n\tSuccessfully built fc46eb9cc4de\r\n\tSuccessfully tagged oracle_jdbc_driver_docker:latest\r\n\r\n### Start Fn\r\n\r\nStart local Fn server\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn start\r\n   \u003e```\r\n\r\nEnsure you are running the latest fn cli (v0.4.153 or above) and fn server (v0.3.545 or above. If you have older version please update the CLI and the server\r\n\r\n- To update the fn cli run the following command\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh\r\n   \u003e```\r\n\r\n- To update the fn server run the following command\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn update sv\r\n   \u003e```\r\n\r\nSwitch context\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn use context default\r\n   \u003e```\r\n\r\nCheck if `default` is now the current context. Run the following command. An `*` is used to indicate the current context as shown below.\r\n\r\n\tfn ls context\r\n\t\r\n\tCURRENT\tNAME\t\t\tPROVIDER\tAPI URL\t\t\tREGISTRY\r\n\t*\tdefault\t\t\t\tdefault\t\thttp://localhost:8080/v1\r\n\t\tworkshop\t\t\toracle\t\thttps://api.test.us-ashburn-1.functions.oci.oraclecloud.com\tiad.ocir.io/oracle-serverless-devrel/workshop-NNN\r\n\r\n\r\nSet registry to a dummy name\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e export FN_REGISTRY=fndemouser\r\n   \u003e```\r\n\r\n\r\n### Create an app with required database configuration\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn create app --config DB_URL=jdbc:oracle:thin:@//129.213.138.81:1521/workshop_iad1hs.sub08241855250.workshoplisbonv.oraclevcn.com --config DB_USER=workshopNNN --config DB_PASSWORD=\u003cpassword\u003e fn-oradb-java-app\r\n   \u003e```\r\n\r\n\u003e Please replace `workshopNNN` in the `DB_USER` attribute with your username (**no hyphen**) and your database password (provided by the lab instructor) in the `DB_PASSWORD` attribute. Please leave the other parameters unchanged since they have been pre-configured based on the lab environment\r\n\r\n## Deploy\r\n\r\nDeploy one function at a time. For example, to deploy the `create` function\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e cd ../create\r\n   \u003e```\r\n\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn -v deploy --app fn-oradb-java-app --local --no-bump\r\n   \u003e```\r\n\r\n\u003e Make sure you do not miss the `--local` option without which Fn will try to push the function Docker images to an external Docker registry\r\n\r\nFor `read` function deployment\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e cd ../read\r\n   \u003e```\r\n\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn -v deploy --app fn-oradb-java-app --local --no-bump\r\n   \u003e```\r\n\r\n\r\n*Repeat for other functions i.e. `delete` and `update`*\r\n\r\nCheck your app (and its config)\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn inspect app fn-oradb-java-app\r\n   \u003e```\r\n\r\n\t\t{\r\n\t\t        \"config\": {\r\n\t\t                \"DB_PASSWORD\": \"t0ps3cr3t\",\r\n\t\t                \"DB_URL\": \"jdbc:oracle:thin:@//129.213.138.81:1521/workshop_iad1hs.sub08241855250.workshoplisbonv.oraclevcn.com\",\r\n\t\t                \"DB_USER\": \"workshop130\"\r\n\t\t        },\r\n\t\t        \"created_at\": \"2018-08-30T07:08:35.791Z\",\r\n\t\t        \"id\": \"01CP4TK42FNG8G00GZJ0000002\",\r\n\t\t        \"name\": \"fn-oradb-java-app\",\r\n\t\t        \"updated_at\": \"2018-08-30T07:24:15.182Z\"\r\n\t\t}\r\n\r\nCheck associated functions\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn list functions fn-oradb-java-app\r\n   \u003e```\r\n\r\n\t\tNAME                            IMAGE\r\n\t\tfn-oradb-app-create-func        fn-oradb-app-create-func:0.0.2\r\n\t\tfn-oradb-app-delete-func        fn-oradb-app-delete-func:0.0.1\r\n\t\tfn-oradb-app-read-func          fn-oradb-app-read-func:0.0.1\r\n\t\tfn-oradb-app-update-func        fn-oradb-app-update-func:0.0.1\r\n\r\n\u003e A custom Docker image has been used as `build_image` (see `func.yaml`) - this Docker image pre-packages the Oracle JDBC driver\r\n\r\n## Test\r\n\r\n.. with Fn CLI using `fn invoke`\r\n\r\n### Create\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n '{\"emp_email\": \"a@b.com\",\"emp_name\": \"abhishek\",\"emp_dept\": \"Product Divison\"}' | fn invoke fn-oradb-java-app fn-oradb-app-create-func\r\n   \u003e```\r\n\r\nIf successful, you should a response similar to this `Created employee CreateEmployeeInfo{emp_email=a@b.com, emp_name=abhishek, emp_dept=Product Divison}`\r\n\r\nCreate as many as you want - make sure that the `emp_email` is unique\r\n\r\n### Read\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e fn invoke fn-oradb-java-app fn-oradb-app-read-func\r\n   \u003e```\r\n\r\n\r\nYou should get back a JSON response similar to below\r\n\r\n\t[\r\n\t  {\r\n\t    \"emp_email\": \"y@z.com\",\r\n\t    \"emp_name\": \"abhishek\",\r\n\t    \"emp_dept\": \"PM\"\r\n\t  },\r\n\t  {\r\n\t    \"emp_email\": \"a@b.com\",\r\n\t    \"emp_name\": \"abhishek\",\r\n\t    \"emp_dept\": \"Product Divison\"\r\n\t  },\r\n\t  {\r\n\t    \"emp_email\": \"x@y.com\",\r\n\t    \"emp_name\": \"kehsihba\",\r\n\t    \"emp_dept\": \"QA Divison\"\r\n\t  }\r\n\t]\r\n\r\nto fetch employee with email `a@b.com`\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n 'a@b.com' | fn invoke fn-oradb-java-app fn-oradb-app-read-func\r\n   \u003e```\r\n\r\n\r\n\t\t[\r\n\t\t  {\r\n\t\t    \"emp_email\": \"a@b.com\",\r\n\t\t    \"emp_name\": \"abhishek\",\r\n\t\t    \"emp_dept\": \"Product Divison\"\r\n\t\t  }\r\n\t\t]\r\n\r\n### Update\r\n\r\nIt is possible to update the department of an employee\r\n\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n '{\"emp_email\": \"a@b.com\", \"emp_dept\": \"Support Operations\"}' | fn invoke fn-oradb-java-app fn-oradb-app-update-func\r\n   \u003e```\r\n\r\nSuccessful invocation will return back a message similar to `Updated employee UpdateEmployeeInfo{emp_email=a@b.com, emp_dept=Support Operations}`\r\n\r\nCheck to make sure - the updated department should reflect\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n 'a@b.com' | fn invoke fn-oradb-java-app fn-oradb-app-read-func\r\n   \u003e```\r\n \r\n\t\t[\r\n\t\t  {\r\n\t\t    \"emp_email\": \"a@b.com\",\r\n\t\t    \"emp_name\": \"abhishek\",\r\n\t\t    \"emp_dept\": \"Support Operations\"\r\n\t\t  }\r\n\t\t]\r\n\r\n### Delete\r\n\r\nUse employee email to specify which employee record you want to delete - you should see `Deleted employee a@b.com` message\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n 'a@b.com' | fn invoke fn-oradb-java-app fn-oradb-app-delete-func\r\n   \u003e```\r\n\r\n \r\nCheck to make sure\r\n\r\n   ![](images/userinput.png)\r\n   \u003e```\r\n   \u003e echo -n 'a@b.com' | fn invoke fn-oradb-java-app fn-oradb-app-read-func\r\n   \u003e```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-oracledb-java-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Ffn-oracledb-java-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Ffn-oracledb-java-workshop/lists"}