Skip to content

Commit ed5637b

Browse files
authored
Merge pull request oracle-samples#2 from oracle/master
Update from master
2 parents 4cad7bd + 1800415 commit ed5637b

File tree

43 files changed

+2988
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2988
-8
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ This repository stores a variety of examples demonstrating how to use the Oracle
88
| [java](./java) | Java based examples |
99
| [javascript](./javascript) | JavaScript based examples |
1010
| [optimizer](./optimizer) | Oracle Optmizer and Optimizer Stats examples |
11+
| [plsql](./plsql) | PL/SQL based examples |
1112
| [python](./python) | Python based examples |
13+
| [ruby](./ruby) | Ruby based examples |
1214
| [sql](./sql) | SQL based examples |
13-
| [sqldeveloper](./sqldeveloper) | [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) Examples |
15+
| [sqldeveloper](./sqldeveloper) | [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) examples |
1416

1517
## Documentation
1618
You can find the online documentation of the Oracle Database under [docs.oracle.com/en/database/](http://docs.oracle.com/en/database/)

java/jdbc/ConnectionManagementSamples/DataSourceSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ such as Universal Connection Pool (UCP), can be configured to use an
3737
public class DataSourceSample {
3838
// The recommended format of a connection URL is the long format with the
3939
// connection descriptor.
40-
final static String DB_URL= "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=myhost)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))";
40+
final static String DB_URL= "jdbc:oracle:thin:@myhost:1521/myorcldbservicename";
4141
final static String DB_USER = "hr";
4242
final static String DB_PASSWORD = "hr";
4343

java/ojvm/SODA.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ The goal of this write up is to furnish the steps for running testSODA.java in O
88

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

11-
(ii) Upload orasoda.jar in your database schema
12-
13-
loadjava -r -v -u hr/hr orajsoda-1.0.4.jar
14-
15-
(iii) Load the [latest javax.json-1.0.4.jar](https://mvnrepository.com/artifact/org.glassfish/javax.json/1.0.4)
11+
(ii) Load the [latest javax.json-1.0.4.jar](https://mvnrepository.com/artifact/org.glassfish/javax.json/1.0.4)
1612

1713
loadjava -r -v -u hr/hr javax.json-1.0.4.jar
14+
15+
(iii) Upload orasoda.jar in your database schema
16+
17+
loadjava -r -v -u hr/hr orajsoda-1.0.5.jar
1818

1919
**Prep testSODA.java for OJVM**
2020

java/ucp/ConnectionManagementSamples/UCPSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The code sample demonstrates Universal Connection Pool (UCP) as a client
3030
import oracle.ucp.jdbc.PoolDataSource;
3131

3232
public class UCPSample {
33-
final static String DB_URL= "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=myhost)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))";
33+
final static String DB_URL= "jdbc:oracle:thin:@myhost:1521/myorcldbservicename";
3434
// Use TNS alias when using tnsnames.ora. Use it while connecting to the database service on cloud.
3535
// final static String DB_URL= "jdbc:oracle:thin:@orcldbaccess";
3636
final static String DB_USER = "hr";

javascript/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ This directory contains Oracle Database JavaScript examples for:
44

55
- JavaScript on the JVM using the Nashorn engine (Hotspot JDk or JRE, other Java SE 8 compliant VMs, OJVM).
66
- node-oracledb for Node.js, allowing you to write mid-tier and networking applications in JavaScript.
7+
- Creating a REST API with Node.js and Oracle Database.

javascript/rest-api/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Creating a REST API with Node.js and Oracle Database
2+
3+
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.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
port: process.env.HTTP_PORT || 3000
3+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const webServer = require('./services/web-server.js');
2+
3+
async function startup() {
4+
console.log('Starting application');
5+
6+
try {
7+
console.log('Initializing web server module');
8+
9+
await webServer.initialize();
10+
} catch (err) {
11+
console.error(err);
12+
13+
process.exit(1); // Non-zero failure code
14+
}
15+
}
16+
17+
startup();
18+
19+
async function shutdown(e) {
20+
let err = e;
21+
22+
console.log('Shutting down');
23+
24+
try {
25+
console.log('Closing web server module');
26+
27+
await webServer.close();
28+
} catch (e) {
29+
console.log('Encountered error', e);
30+
31+
err = err || e;
32+
}
33+
34+
console.log('Exiting process');
35+
36+
if (err) {
37+
process.exit(1); // Non-zero failure code
38+
} else {
39+
process.exit(0);
40+
}
41+
}
42+
43+
process.on('SIGTERM', () => {
44+
console.log('Received SIGTERM');
45+
46+
shutdown();
47+
});
48+
49+
process.on('SIGINT', () => {
50+
console.log('Received SIGINT');
51+
52+
shutdown();
53+
});
54+
55+
process.on('uncaughtException', err => {
56+
console.log('Uncaught exception');
57+
console.error(err);
58+
59+
shutdown(err);
60+
});

0 commit comments

Comments
 (0)