SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Oracle Developer
Node.js und die Oracle-Datenbank
Carsten Czarski
Business Unit Database
Oracle Deutschland B.V. & Co KG
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Inhalt
• Node.js: Was ist das
• Der Treiber für die Oracle-Datenbank: node-oracledb
• Node.js und die Oracle-Datenbank am Beispiel
– 1: Zugriff auf eine Tabelle und Ausgabe auf der Konsole
– 2: Ausgabe von Tabellendaten als JSON über HTTP
– 3: Mail-Listener: Automatisches Laden von Mails in Tabellen
– 4: WebSockets meets Oracle Database
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Node.js
Node.js is an open source, cross-platform runtime environment for server-side and
networking applications. Node.js applications are written in JavaScript, and can be run
within the Node.js runtime.
Node.js provides an event-driven architecture and a non-blocking I/O API that optimizes
an application's throughput and scalability. These technologies are commonly used for
real-time web applications.
Node.js uses the Google V8 JavaScript engine to execute code, and a large percentage of
the basic modules are written in JavaScript. Node.js contains a built-in library to allow
applications to act as a Web server without software such as Apache HTTP Server or IIS.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Javascript auf dem Server
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Node.js ...
• ... basiert auf der Google V8 Engine (JavaScript)
– Open Source seit 2008
– Implementiert in C++
– Kompiliert Javascript mit einem Just In Time Compiler
• ... ist asynchron und eventgetrieben
– I/O-Gebundene API Calls sind nicht-blockierend
– Entwickler übergibt eine Callback-Funktion
– Interne Verwendung einer Event Queue
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Klassischer (synchroner) Programmablauf
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Asynchroner Programmablauf mit node.js
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Node Packaged Modules (npm)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Populäre node.js Pakete
• Express: HTTP Server
• MailListener: Liest Mails aus einem IMAP/POP Postfach aus
• Websockets: Server für HTML5 Websocket-Technologie
• Webshot: HTML-Seiten abrufen und als Bild speichern
• Node-Oracledb: Oracle-Datenbanktreiber für node.js
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
node-oracledb
• node.js Treiber für die Oracle-Datenbank
– "Offizieller" Treiber für die Oracle-Datenbank
– Derzeit verfügbar: Version 0.2 (Early Adopter)
– Produktionsversion wird 1.0 sein
• Features
– SQL and PL/SQL Execution, Binding using JavaScript objects or arrays, Query results as
JavaScript objects or array, Conversion between JavaScript and Oracle types
– Transaction Management, Connection Pooling, Statement Caching, Client Result
Caching, End-to-end tracing
– High Availability Features: Fast Application Notification (FAN), Runtime Load
Balancing (RLB), Transparent Application Failover (TAF)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Download von GitHub
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Voraussetzung: Python muss installiert sein
• Version zwischen 2.5 und 3.0
$ python2.7
Python 2.7.9 (default, Jan 29 2015, 17:33:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Installation node.js und node-oracledb
ZIP-Archive
auspacken
Node.js
testen
Build node-
oracledb
Umgebung
vorbereiten
Erstes
Programm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Voraussetzungen – Linux-System
• Download und Auspacken der ZIP-Archive
• $ORACLE_HOMEOracle Instant Client (Basic + SDK)
• $NODE_HOMENode.js
• $NODE_ORACLEDB_HOMENode-oracledb
$ ls
instantclient_12_1 node-v0.10.36-linux-x64 node-oracledb-master
$
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Installation node.js und node-oracledb
ZIP-Archive
auspacken
Node.js
testen
Build node-
oracledb
Umgebung
vorbereiten
Erstes
Programm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Node.js installieren und einrichten
• Starten von node.js mit "$NODE_HOME/bin/node"
• Starten des Paketmanagers npm mit "$NODE_HOME/bin/node"
$ cd $NODE_HOME
$ ls
bin ChangeLog include lib LICENSE node_modules README.md share
$ ls ./bin
node npm
$ $NODE_HOME/bin/node -v
v0.10.36
$ $NODE_HOME/bin/npm -v
1.4.28
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Proxy-Server und Umgebungsvariablen
• Falls Node.js Umgebung hinter der Firewall
• Package Manager braucht Internetverbindung
$ export PATH=$NODE_HOME/bin:$PATH
$ npm config set proxy=http://{proxy-server}:{port}
$ npm config set https-proxy=http://{proxy-server}:{port}
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Installation node.js und node-oracledb
ZIP-Archive
auspacken
Node.js
testen
Build node-
oracledb
Umgebung
vorbereiten
Erstes
Programm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Oracle Instant Client installieren
• Verzeichnisstruktur nach Auspacken des ZIP-Archivs
$ cd $ORACLE_HOME
$ find
.
./uidrvci
./libocci.so.12.1
./libociei.so
:
./xstreams.jar
./sdk
./sdk/include
./sdk/include/occiCommon.h
./sdk/include/occi.h
./sdk/include/occiData.h
:
Instantclient
"BASIC"
Instantclient
"SDK"
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Umgebung für Build von "node-oracledb" vorbereiten
• Symlink erzeugen
• Umgebungsvariablen setzen
$ ls $ORACLE_HOME/libcntsh.*
libclntshcore.so.12.1 libclntsh.so.12.1
$ ln –s libclntsh.so.12.1 libclntsh.so
$ ls
libclntshcore.so.12.1 libclntsh.so libclntsh.so.12.1
$ export OCI_LIB_DIR = $ORACLE_HOME # Einmalig für Build
$ export OCI_INC_DIR = $ORACLE_HOME/sdk/include # Einmalig für Build
$ export LD_LIBRARY_PATH = $ORACLE_HOME:$LD_LIBRARY_PATH # Immer nötig
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Build von "node-oracledb"
$ cd $NODE_ORACLEDB_HOME
$ npm install
> oracledb@0.2.4 install /home/oracle/node-oracledb-master
> node-gyp rebuild
make: Entering directory `/home/oracle/node-oracledb-master/build'
CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o
SOLINK_MODULE(target) Release/obj.target/oracledb.node
SOLINK_MODULE(target) Release/obj.target/oracledb.node: Finished
COPY Release/oracledb.node
make: Leaving directory `/home/oracle/node-oracledb-master/build'
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Installation node.js und node-oracledb
ZIP-Archive
auspacken
Node.js
testen
Build node-
oracledb
Umgebung
vorbereiten
Erstes
Programm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Arbeitsumgebung erzeugen
• $ mkdir /home/oracle/nodework
• $ cd /home/oracle/nodework
• $ mkdir node_modules
• $ cd node_modules
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
"node-oracledb" nach "node_modules" verschieben
• $ mkdir /home/oracle/nodework
• $ cd /home/oracle/nodework
• $ mkdir node_modules
• $ cd node_modules
• $ mv $NODE_ORACLEDB_HOME .
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
"node-oracledb" nach "node_modules" verschieben
• $ mkdir /home/oracle/nodework
• $ cd /home/oracle/nodework
• $ mkdir node_modules
• $ cd node_modules
• $ mv $NODE_ORACLEDB_HOME .
• $ mv node-oracledb-master oracledb
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Installation node.js und node-oracledb
ZIP-Archive
auspacken
Node.js
testen
Build node-
oracledb
Umgebung
vorbereiten
Erstes
Programm
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Das erste "node-oracledb" Programm: emp.js
var oracledb = require('oracledb');
oracledb.getConnection(
{
user : "scott",
password : "tiger",
connectString : "sccloud033:1521/orcl"
},
function(err, connection) {
if (err) {console.error(err.message); return;}
connection.execute(
"SELECT * from EMP where EMPNO=7839",
[],
function(err, result) {
if (err) {console.log('%s', err.message); return;}
console.log(result.rows);
}
);
});
console.log("Finished – really?");
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Verzeichnisstruktur
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Test: Das erste Node.js Programm
$ node emp.js
Finished. Really????
[ [ 7839,
'KING',
'PRESIDENT',
null,
Tue Nov 17 1981 00:00:00 GMT+0100 (CET),
5000,
null,
10 ] ]
$
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Zweites Programm: "JSON-HTTP-Server"
var oracledb = require('oracledb');
var http = require('http');
oracledb.createPool(
{
user : "scott",
password : "tiger",
connectString : "sccloud033:1521/orcl",
poolMin : 1,
poolMax : 20
},
function(err, pool){
if (err) { ... }
http.createServer(function (req, res) {
pool.getConnection(function(err, connection){
if (err) { ... }
connection.execute("select * from emp ", [], function(err, results) {
if (err) { ... }
connection.release(function (err) {
if (err) { ... }
});
res.writeHead(200, {'Content-Type': 'application/json'});!
res.end(JSON.stringify(results.rows));
})
})
}).listen(1234, 'sccloud033.de.oracle.com')
});
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Zweites Programm: "JSON-HTTP-Server"
var oracledb = require('oracledb');
var http = require('http');
oracledb.createPool(
{
user : "scott",
password : "tiger",
connectString : "sccloud033:1521/orcl",
poolMin : 1,
poolMax : 20
},
function(err, pool){
if (err) { ... }
http.createServer(function (req, res) {
pool.getConnection(function(err, connection){
if (err) { ... }
connection.execute("select * from emp ", [], function(err, results) {
if (err) { ... }
connection.release(function (err) {
if (err) { ... }
});
res.writeHead(200, {'Content-Type': 'application/json'});!
res.end(JSON.stringify(results.rows));
})
})
}).listen(1234, 'sccloud033.de.oracle.com')
});
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Verzeichnisstruktur nach "npm install express"
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Express: Einfacher Webserver
var express = require('express')
function startServer () {
var app = express();
app.get ("/emp/*", processEmp);
app.get ("/dept/*", processDept);
var server = app.listen(9000, function () {
var host = server.address().address
var port = server.address().port
console.log('Table EMP REST Service listening at http://%s:%s', host, port);
});
}
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Express: Einfacher Webserver
function processEmp(req, res) {
pool.getConnection(function(err, connection){
connection.execute(
"select * from emp where (empno=:1 or :1 is null)",
[req.params[0]],
function(err, results) {
connection.release(function (err) {}),
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify(results.rows));
}
)
})
}
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Ein wichtiger Tipp zwischendurch ...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
IMAP Integration: Mail Listener
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Verzeichnisstruktur nach "npm install mail-listener2"
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MailListener2: IMAP-Server mit Tabelle verbinden
var mailListener = new MailListener({
username: "vorname.nachname@mycompany.com",
password: "***********",
host: "mailserver.mycompany.com",
port: 993,
tls: true,
tlsOpTions: { rejectUnauthorized: false },
mailbox: "INBOX",
searchFilter: ["UNSEEN"],
markSeen: true,
fetchUnreadOnStart: false,
mailParserOptions: {streamAttachments: true},
attachments: false
});
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MailListener2: IMAP-Server mit Tabelle verbinden
mailListener.on("mail", function(mail, seqno, attributes) {
if (mail.subject.match(/^MAIL_NODETEST.*/)) {
pool.getConnection(function(err, connection){
connection.execute(
"insert into mails_nodejs (sender, subject, datetime) values (:1, :2, :3)",
[mail.from[0].address, mail.subject, mail.date],
function(err, results) {
if (err) { console.log(err); }
connection.commit(function (err) {…});
connection.release(function (err) {…});
console.log("storing message: "" + mail.subject + """);
}
)
})
} else {
console.log("Ignoring Message: ""+mail.subject+""");
}
});
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
HTML5-Websocket: Asynchrone Client-Benachrichtigung
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
HTML5 Websockets
• Bidirektionale Verbindung zwischen Browser und Webserver
– Browser sendet HTTP-Anfrage mit Upgrade Request für Websocket
– Verbindung bleibt nach Server-Antwort offen
– Server kann weitere Daten ohne erneute Client-Anfrage senden
• Nutzen
– Gut geeignet für jede Form der asynchronen Benachrichtigung
– Ständiges Polling des Clients zum Server fällt weg
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
HTML5 Websockets im Internet
Internet erfordert
viele offene
Websockets
Leichtgewichtige
Server-Technologie
nötig
Node.js
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
HTML5 Websockets mit Node.js
DEMO
Oracle Confidential – 4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Weitere Informationen
• Node.js Info und Download
http://nodejs.org
• Node Package Manager
http://npmjs.org
• Oracle-Treiber node-oracledb auf Github
https://github.com/oracle/node-oracledb
• Node.js Developer Center im OTN
http://www.oracle.com/technetwork/database/database-technologies/node_js/oracle-node-js-2399407.html
• Diskussionsforum node.js und Oracle
https://community.oracle.com/community/database/developer-tools/node_js/content
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Carsten.Czarski@oracle.com
http://tinyurl.com/apexcommunity
http://sql-plsql-de.blogspot.com
http://plsqlexecoscomm.sourceforge.net
http://plsqlmailclient.sourceforge.net
Twitter: @cczarski @oraclebudb
Nächster Oracle Developer Monthly
20. Februar 2015 – 09:00 Uhr

Contenu connexe

Tendances

Spark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotronSpark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotronDuyhai Doan
 
Elasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionElasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionDavid Pilato
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scalatakezoe
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchRafał Kuć
 
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur! Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur! David Delabassee
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Logico
 
How to build your query engine in spark
How to build your query engine in sparkHow to build your query engine in spark
How to build your query engine in sparkPeng Cheng
 
Battle of the giants: Apache Solr vs ElasticSearch
Battle of the giants: Apache Solr vs ElasticSearchBattle of the giants: Apache Solr vs ElasticSearch
Battle of the giants: Apache Solr vs ElasticSearchRafał Kuć
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?Edward Burns
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the CloudDmitry Kornilov
 
Configuration with Apache Tamaya
Configuration with Apache TamayaConfiguration with Apache Tamaya
Configuration with Apache TamayaAnatole Tresch
 
Oracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG EditionOracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG EditionJeff Smith
 
Configuration for Java EE: Config JSR and Tamaya
Configuration for Java EE: Config JSR and TamayaConfiguration for Java EE: Config JSR and Tamaya
Configuration for Java EE: Config JSR and TamayaDmitry Kornilov
 
Data stax academy
Data stax academyData stax academy
Data stax academyDuyhai Doan
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performancegvenzl
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)Logico
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...smn-automate
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaAnatole Tresch
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewMadhur Nawandar
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleSean Chittenden
 

Tendances (20)

Spark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotronSpark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotron
 
Elasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionElasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English version
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scala
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and Elasticsearch
 
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur! Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)
 
How to build your query engine in spark
How to build your query engine in sparkHow to build your query engine in spark
How to build your query engine in spark
 
Battle of the giants: Apache Solr vs ElasticSearch
Battle of the giants: Apache Solr vs ElasticSearchBattle of the giants: Apache Solr vs ElasticSearch
Battle of the giants: Apache Solr vs ElasticSearch
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the Cloud
 
Configuration with Apache Tamaya
Configuration with Apache TamayaConfiguration with Apache Tamaya
Configuration with Apache Tamaya
 
Oracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG EditionOracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG Edition
 
Configuration for Java EE: Config JSR and Tamaya
Configuration for Java EE: Config JSR and TamayaConfiguration for Java EE: Config JSR and Tamaya
Configuration for Java EE: Config JSR and Tamaya
 
Data stax academy
Data stax academyData stax academy
Data stax academy
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performance
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
 
Configure Your Projects with Apache Tamaya
Configure Your Projects with Apache TamayaConfigure Your Projects with Apache Tamaya
Configure Your Projects with Apache Tamaya
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overview
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
 

En vedette

Greg Mohr Portfolio 1997-2004
Greg Mohr Portfolio 1997-2004Greg Mohr Portfolio 1997-2004
Greg Mohr Portfolio 1997-2004Greg Mohr
 
Präsentation plug in development
Präsentation plug in developmentPräsentation plug in development
Präsentation plug in developmentxxtesaxx
 
Selfies auf Instagram, Pinterest und Snapchat
Selfies auf Instagram, Pinterest und SnapchatSelfies auf Instagram, Pinterest und Snapchat
Selfies auf Instagram, Pinterest und Snapchatpechakucha1
 
JÖBSTL Firmenvorstellung 2016 (DE)
JÖBSTL Firmenvorstellung 2016 (DE)JÖBSTL Firmenvorstellung 2016 (DE)
JÖBSTL Firmenvorstellung 2016 (DE)Atanas Vassilev
 
Norwich Estates
Norwich EstatesNorwich Estates
Norwich EstatesKarl Amc
 
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben Auskunft
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben AuskunftWovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben Auskunft
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben AuskunftEuroforum Deutschland GmbH
 
Sojola: Blogger Relations, Blog & Website
Sojola: Blogger Relations, Blog & WebsiteSojola: Blogger Relations, Blog & Website
Sojola: Blogger Relations, Blog & WebsiteSMART PR
 

En vedette (16)

TIK KELAS 9 BAB 2
TIK KELAS 9 BAB 2TIK KELAS 9 BAB 2
TIK KELAS 9 BAB 2
 
Gefuehle
GefuehleGefuehle
Gefuehle
 
Greg Mohr Portfolio 1997-2004
Greg Mohr Portfolio 1997-2004Greg Mohr Portfolio 1997-2004
Greg Mohr Portfolio 1997-2004
 
Bisnode Branchenreport Maschinenbau 2014
Bisnode Branchenreport Maschinenbau 2014Bisnode Branchenreport Maschinenbau 2014
Bisnode Branchenreport Maschinenbau 2014
 
Danke prinzipessa
Danke prinzipessaDanke prinzipessa
Danke prinzipessa
 
Präsentation plug in development
Präsentation plug in developmentPräsentation plug in development
Präsentation plug in development
 
Selfies auf Instagram, Pinterest und Snapchat
Selfies auf Instagram, Pinterest und SnapchatSelfies auf Instagram, Pinterest und Snapchat
Selfies auf Instagram, Pinterest und Snapchat
 
Prn1
Prn1Prn1
Prn1
 
JÖBSTL Firmenvorstellung 2016 (DE)
JÖBSTL Firmenvorstellung 2016 (DE)JÖBSTL Firmenvorstellung 2016 (DE)
JÖBSTL Firmenvorstellung 2016 (DE)
 
Norwich Estates
Norwich EstatesNorwich Estates
Norwich Estates
 
TIK KELAS 9 BAB 2
TIK KELAS 9 BAB 2TIK KELAS 9 BAB 2
TIK KELAS 9 BAB 2
 
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben Auskunft
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben AuskunftWovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben Auskunft
Wovor fürchten sich deutsche Manager? Über 130 Führungskräfte geben Auskunft
 
SALES FOLDER_BCN
SALES FOLDER_BCNSALES FOLDER_BCN
SALES FOLDER_BCN
 
bc.prace_LK_final
bc.prace_LK_finalbc.prace_LK_final
bc.prace_LK_final
 
Halbzeit!
Halbzeit! Halbzeit!
Halbzeit!
 
Sojola: Blogger Relations, Blog & Website
Sojola: Blogger Relations, Blog & WebsiteSojola: Blogger Relations, Blog & Website
Sojola: Blogger Relations, Blog & Website
 

Similaire à Node.js und Oracle Database

Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsPetr Jiricka
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containersDocker, Inc.
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingDan Davis
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsCodefresh
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeJAXLondon2014
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Codemotion Tel Aviv
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database gvenzl
 
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarWicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarKamesh Pemmaraju
 
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...eZ Systems
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS drupalcampest
 
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
Project Avatar (Lyon JUG & Alpes JUG  - March 2014)Project Avatar (Lyon JUG & Alpes JUG  - March 2014)
Project Avatar (Lyon JUG & Alpes JUG - March 2014)David Delabassee
 

Similaire à Node.js und Oracle Database (20)

Core os dna_automacon
Core os dna_automaconCore os dna_automacon
Core os dna_automacon
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
 
Core os dna_oscon
Core os dna_osconCore os dna_oscon
Core os dna_oscon
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containers
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
Oracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node finalOracle application container cloud back end integration using node final
Oracle application container cloud back end integration using node final
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database
 
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarWicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
 
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
Project Avatar (Lyon JUG & Alpes JUG  - March 2014)Project Avatar (Lyon JUG & Alpes JUG  - March 2014)
Project Avatar (Lyon JUG & Alpes JUG - March 2014)
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 

Dernier

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Dernier (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 

Node.js und Oracle Database

  • 1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Oracle Developer Node.js und die Oracle-Datenbank Carsten Czarski Business Unit Database Oracle Deutschland B.V. & Co KG
  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Inhalt • Node.js: Was ist das • Der Treiber für die Oracle-Datenbank: node-oracledb • Node.js und die Oracle-Datenbank am Beispiel – 1: Zugriff auf eine Tabelle und Ausgabe auf der Konsole – 2: Ausgabe von Tabellendaten als JSON über HTTP – 3: Mail-Listener: Automatisches Laden von Mails in Tabellen – 4: WebSockets meets Oracle Database
  • 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Node.js Node.js is an open source, cross-platform runtime environment for server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime. Node.js provides an event-driven architecture and a non-blocking I/O API that optimizes an application's throughput and scalability. These technologies are commonly used for real-time web applications. Node.js uses the Google V8 JavaScript engine to execute code, and a large percentage of the basic modules are written in JavaScript. Node.js contains a built-in library to allow applications to act as a Web server without software such as Apache HTTP Server or IIS.
  • 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Javascript auf dem Server
  • 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Node.js ... • ... basiert auf der Google V8 Engine (JavaScript) – Open Source seit 2008 – Implementiert in C++ – Kompiliert Javascript mit einem Just In Time Compiler • ... ist asynchron und eventgetrieben – I/O-Gebundene API Calls sind nicht-blockierend – Entwickler übergibt eine Callback-Funktion – Interne Verwendung einer Event Queue
  • 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Klassischer (synchroner) Programmablauf
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Asynchroner Programmablauf mit node.js
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Node Packaged Modules (npm)
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Populäre node.js Pakete • Express: HTTP Server • MailListener: Liest Mails aus einem IMAP/POP Postfach aus • Websockets: Server für HTML5 Websocket-Technologie • Webshot: HTML-Seiten abrufen und als Bild speichern • Node-Oracledb: Oracle-Datenbanktreiber für node.js
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. node-oracledb • node.js Treiber für die Oracle-Datenbank – "Offizieller" Treiber für die Oracle-Datenbank – Derzeit verfügbar: Version 0.2 (Early Adopter) – Produktionsversion wird 1.0 sein • Features – SQL and PL/SQL Execution, Binding using JavaScript objects or arrays, Query results as JavaScript objects or array, Conversion between JavaScript and Oracle types – Transaction Management, Connection Pooling, Statement Caching, Client Result Caching, End-to-end tracing – High Availability Features: Fast Application Notification (FAN), Runtime Load Balancing (RLB), Transparent Application Failover (TAF)
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Download von GitHub
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Voraussetzung: Python muss installiert sein • Version zwischen 2.5 und 3.0 $ python2.7 Python 2.7.9 (default, Jan 29 2015, 17:33:10) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Installation node.js und node-oracledb ZIP-Archive auspacken Node.js testen Build node- oracledb Umgebung vorbereiten Erstes Programm
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Voraussetzungen – Linux-System • Download und Auspacken der ZIP-Archive • $ORACLE_HOMEOracle Instant Client (Basic + SDK) • $NODE_HOMENode.js • $NODE_ORACLEDB_HOMENode-oracledb $ ls instantclient_12_1 node-v0.10.36-linux-x64 node-oracledb-master $
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Installation node.js und node-oracledb ZIP-Archive auspacken Node.js testen Build node- oracledb Umgebung vorbereiten Erstes Programm
  • 16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Node.js installieren und einrichten • Starten von node.js mit "$NODE_HOME/bin/node" • Starten des Paketmanagers npm mit "$NODE_HOME/bin/node" $ cd $NODE_HOME $ ls bin ChangeLog include lib LICENSE node_modules README.md share $ ls ./bin node npm $ $NODE_HOME/bin/node -v v0.10.36 $ $NODE_HOME/bin/npm -v 1.4.28
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Proxy-Server und Umgebungsvariablen • Falls Node.js Umgebung hinter der Firewall • Package Manager braucht Internetverbindung $ export PATH=$NODE_HOME/bin:$PATH $ npm config set proxy=http://{proxy-server}:{port} $ npm config set https-proxy=http://{proxy-server}:{port}
  • 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Installation node.js und node-oracledb ZIP-Archive auspacken Node.js testen Build node- oracledb Umgebung vorbereiten Erstes Programm
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Oracle Instant Client installieren • Verzeichnisstruktur nach Auspacken des ZIP-Archivs $ cd $ORACLE_HOME $ find . ./uidrvci ./libocci.so.12.1 ./libociei.so : ./xstreams.jar ./sdk ./sdk/include ./sdk/include/occiCommon.h ./sdk/include/occi.h ./sdk/include/occiData.h : Instantclient "BASIC" Instantclient "SDK"
  • 20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Umgebung für Build von "node-oracledb" vorbereiten • Symlink erzeugen • Umgebungsvariablen setzen $ ls $ORACLE_HOME/libcntsh.* libclntshcore.so.12.1 libclntsh.so.12.1 $ ln –s libclntsh.so.12.1 libclntsh.so $ ls libclntshcore.so.12.1 libclntsh.so libclntsh.so.12.1 $ export OCI_LIB_DIR = $ORACLE_HOME # Einmalig für Build $ export OCI_INC_DIR = $ORACLE_HOME/sdk/include # Einmalig für Build $ export LD_LIBRARY_PATH = $ORACLE_HOME:$LD_LIBRARY_PATH # Immer nötig
  • 21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Build von "node-oracledb" $ cd $NODE_ORACLEDB_HOME $ npm install > oracledb@0.2.4 install /home/oracle/node-oracledb-master > node-gyp rebuild make: Entering directory `/home/oracle/node-oracledb-master/build' CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o SOLINK_MODULE(target) Release/obj.target/oracledb.node SOLINK_MODULE(target) Release/obj.target/oracledb.node: Finished COPY Release/oracledb.node make: Leaving directory `/home/oracle/node-oracledb-master/build'
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Installation node.js und node-oracledb ZIP-Archive auspacken Node.js testen Build node- oracledb Umgebung vorbereiten Erstes Programm
  • 23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Arbeitsumgebung erzeugen • $ mkdir /home/oracle/nodework • $ cd /home/oracle/nodework • $ mkdir node_modules • $ cd node_modules
  • 24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. "node-oracledb" nach "node_modules" verschieben • $ mkdir /home/oracle/nodework • $ cd /home/oracle/nodework • $ mkdir node_modules • $ cd node_modules • $ mv $NODE_ORACLEDB_HOME .
  • 25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. "node-oracledb" nach "node_modules" verschieben • $ mkdir /home/oracle/nodework • $ cd /home/oracle/nodework • $ mkdir node_modules • $ cd node_modules • $ mv $NODE_ORACLEDB_HOME . • $ mv node-oracledb-master oracledb
  • 26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Installation node.js und node-oracledb ZIP-Archive auspacken Node.js testen Build node- oracledb Umgebung vorbereiten Erstes Programm
  • 27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Das erste "node-oracledb" Programm: emp.js var oracledb = require('oracledb'); oracledb.getConnection( { user : "scott", password : "tiger", connectString : "sccloud033:1521/orcl" }, function(err, connection) { if (err) {console.error(err.message); return;} connection.execute( "SELECT * from EMP where EMPNO=7839", [], function(err, result) { if (err) {console.log('%s', err.message); return;} console.log(result.rows); } ); }); console.log("Finished – really?");
  • 28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Verzeichnisstruktur
  • 29. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Test: Das erste Node.js Programm $ node emp.js Finished. Really???? [ [ 7839, 'KING', 'PRESIDENT', null, Tue Nov 17 1981 00:00:00 GMT+0100 (CET), 5000, null, 10 ] ] $
  • 30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Zweites Programm: "JSON-HTTP-Server" var oracledb = require('oracledb'); var http = require('http'); oracledb.createPool( { user : "scott", password : "tiger", connectString : "sccloud033:1521/orcl", poolMin : 1, poolMax : 20 }, function(err, pool){ if (err) { ... } http.createServer(function (req, res) { pool.getConnection(function(err, connection){ if (err) { ... } connection.execute("select * from emp ", [], function(err, results) { if (err) { ... } connection.release(function (err) { if (err) { ... } }); res.writeHead(200, {'Content-Type': 'application/json'});! res.end(JSON.stringify(results.rows)); }) }) }).listen(1234, 'sccloud033.de.oracle.com') });
  • 31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Zweites Programm: "JSON-HTTP-Server" var oracledb = require('oracledb'); var http = require('http'); oracledb.createPool( { user : "scott", password : "tiger", connectString : "sccloud033:1521/orcl", poolMin : 1, poolMax : 20 }, function(err, pool){ if (err) { ... } http.createServer(function (req, res) { pool.getConnection(function(err, connection){ if (err) { ... } connection.execute("select * from emp ", [], function(err, results) { if (err) { ... } connection.release(function (err) { if (err) { ... } }); res.writeHead(200, {'Content-Type': 'application/json'});! res.end(JSON.stringify(results.rows)); }) }) }).listen(1234, 'sccloud033.de.oracle.com') });
  • 32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
  • 33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Verzeichnisstruktur nach "npm install express"
  • 34. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Express: Einfacher Webserver var express = require('express') function startServer () { var app = express(); app.get ("/emp/*", processEmp); app.get ("/dept/*", processDept); var server = app.listen(9000, function () { var host = server.address().address var port = server.address().port console.log('Table EMP REST Service listening at http://%s:%s', host, port); }); }
  • 35. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Express: Einfacher Webserver function processEmp(req, res) { pool.getConnection(function(err, connection){ connection.execute( "select * from emp where (empno=:1 or :1 is null)", [req.params[0]], function(err, results) { connection.release(function (err) {}), res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify(results.rows)); } ) }) }
  • 36. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Ein wichtiger Tipp zwischendurch ...
  • 37. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. IMAP Integration: Mail Listener
  • 38. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Verzeichnisstruktur nach "npm install mail-listener2"
  • 39. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. MailListener2: IMAP-Server mit Tabelle verbinden var mailListener = new MailListener({ username: "vorname.nachname@mycompany.com", password: "***********", host: "mailserver.mycompany.com", port: 993, tls: true, tlsOpTions: { rejectUnauthorized: false }, mailbox: "INBOX", searchFilter: ["UNSEEN"], markSeen: true, fetchUnreadOnStart: false, mailParserOptions: {streamAttachments: true}, attachments: false });
  • 40. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. MailListener2: IMAP-Server mit Tabelle verbinden mailListener.on("mail", function(mail, seqno, attributes) { if (mail.subject.match(/^MAIL_NODETEST.*/)) { pool.getConnection(function(err, connection){ connection.execute( "insert into mails_nodejs (sender, subject, datetime) values (:1, :2, :3)", [mail.from[0].address, mail.subject, mail.date], function(err, results) { if (err) { console.log(err); } connection.commit(function (err) {…}); connection.release(function (err) {…}); console.log("storing message: "" + mail.subject + """); } ) }) } else { console.log("Ignoring Message: ""+mail.subject+"""); } });
  • 41. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. HTML5-Websocket: Asynchrone Client-Benachrichtigung
  • 42. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. HTML5 Websockets • Bidirektionale Verbindung zwischen Browser und Webserver – Browser sendet HTTP-Anfrage mit Upgrade Request für Websocket – Verbindung bleibt nach Server-Antwort offen – Server kann weitere Daten ohne erneute Client-Anfrage senden • Nutzen – Gut geeignet für jede Form der asynchronen Benachrichtigung – Ständiges Polling des Clients zum Server fällt weg
  • 43. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. HTML5 Websockets im Internet Internet erfordert viele offene Websockets Leichtgewichtige Server-Technologie nötig Node.js
  • 44. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. HTML5 Websockets mit Node.js DEMO Oracle Confidential – 4
  • 45. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
  • 46. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
  • 47. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Weitere Informationen • Node.js Info und Download http://nodejs.org • Node Package Manager http://npmjs.org • Oracle-Treiber node-oracledb auf Github https://github.com/oracle/node-oracledb • Node.js Developer Center im OTN http://www.oracle.com/technetwork/database/database-technologies/node_js/oracle-node-js-2399407.html • Diskussionsforum node.js und Oracle https://community.oracle.com/community/database/developer-tools/node_js/content
  • 48. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Carsten.Czarski@oracle.com http://tinyurl.com/apexcommunity http://sql-plsql-de.blogspot.com http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net Twitter: @cczarski @oraclebudb Nächster Oracle Developer Monthly 20. Februar 2015 – 09:00 Uhr