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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ This repository stores a variety of examples demonstrating how to use the Oracle
| [java](./java) | Java based examples |
| [javascript](./javascript) | JavaScript based examples |
| [optimizer](./optimizer) | Oracle Optmizer and Optimizer Stats examples |
| [plsql](./plsql) | PL/SQL based examples |
| [python](./python) | Python based examples |
| [ruby](./ruby) | Ruby based examples |
| [sql](./sql) | SQL based examples |
| [sqldeveloper](./sqldeveloper) | [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) Examples |
| [sqldeveloper](./sqldeveloper) | [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) examples |

## Documentation
You can find the online documentation of the Oracle Database under [docs.oracle.com/en/database/](http://docs.oracle.com/en/database/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ such as Universal Connection Pool (UCP), can be configured to use an
public class DataSourceSample {
// The recommended format of a connection URL is the long format with the
// connection descriptor.
final static String DB_URL= "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=myhost)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))";
final static String DB_URL= "jdbc:oracle:thin:@myhost:1521/myorcldbservicename";
final static String DB_USER = "hr";
final static String DB_PASSWORD = "hr";

Expand Down
10 changes: 5 additions & 5 deletions java/ojvm/SODA.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The goal of this write up is to furnish the steps for running testSODA.java in O

(i) Download the [latest orajsoda.jar](https://github.com/oracle/soda-for-java/releases) currently orajsoda-1.0.4.jar

(ii) Upload orasoda.jar in your database schema

loadjava -r -v -u hr/hr orajsoda-1.0.4.jar

(iii) Load the [latest javax.json-1.0.4.jar](https://mvnrepository.com/artifact/org.glassfish/javax.json/1.0.4)
(ii) Load the [latest javax.json-1.0.4.jar](https://mvnrepository.com/artifact/org.glassfish/javax.json/1.0.4)

loadjava -r -v -u hr/hr javax.json-1.0.4.jar

(iii) Upload orasoda.jar in your database schema

loadjava -r -v -u hr/hr orajsoda-1.0.5.jar

**Prep testSODA.java for OJVM**

Expand Down
2 changes: 1 addition & 1 deletion java/ucp/ConnectionManagementSamples/UCPSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The code sample demonstrates Universal Connection Pool (UCP) as a client
import oracle.ucp.jdbc.PoolDataSource;

public class UCPSample {
final static String DB_URL= "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=myhost)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))";
final static String DB_URL= "jdbc:oracle:thin:@myhost:1521/myorcldbservicename";
// Use TNS alias when using tnsnames.ora. Use it while connecting to the database service on cloud.
// final static String DB_URL= "jdbc:oracle:thin:@orcldbaccess";
final static String DB_USER = "hr";
Expand Down
1 change: 1 addition & 0 deletions javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ This directory contains Oracle Database JavaScript examples for:

- JavaScript on the JVM using the Nashorn engine (Hotspot JDk or JRE, other Java SE 8 compliant VMs, OJVM).
- node-oracledb for Node.js, allowing you to write mid-tier and networking applications in JavaScript.
- Creating a REST API with Node.js and Oracle Database.
3 changes: 3 additions & 0 deletions javascript/rest-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Creating a REST API with Node.js and Oracle Database

This folder contains sample code from the [Creating a REST API with Node.js and Oracle Database](https://jsao.io/2018/03/creating-a-rest-api-with-node-js-and-oracle-database/) blog series. See that post for more details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
port: process.env.HTTP_PORT || 3000
};
60 changes: 60 additions & 0 deletions javascript/rest-api/part-1-web-server-basics/hr_app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const webServer = require('./services/web-server.js');

async function startup() {
console.log('Starting application');

try {
console.log('Initializing web server module');

await webServer.initialize();
} catch (err) {
console.error(err);

process.exit(1); // Non-zero failure code
}
}

startup();

async function shutdown(e) {
let err = e;

console.log('Shutting down');

try {
console.log('Closing web server module');

await webServer.close();
} catch (e) {
console.log('Encountered error', e);

err = err || e;
}

console.log('Exiting process');

if (err) {
process.exit(1); // Non-zero failure code
} else {
process.exit(0);
}
}

process.on('SIGTERM', () => {
console.log('Received SIGTERM');

shutdown();
});

process.on('SIGINT', () => {
console.log('Received SIGINT');

shutdown();
});

process.on('uncaughtException', err => {
console.log('Uncaught exception');
console.error(err);

shutdown(err);
});
Loading