DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Avatar

Dan McGhan

Developer Advocate at Oracle

Brooklyn, US

Joined Jul 2017

About

@dmcghan

Stats

Reputation: 980
Pageviews: 950.4K
Articles: 22
Comments: 4
  • Articles
  • Comments

Articles

article thumbnail
Authenticating End-Users With Node.js and Oracle Identity Cloud Service
Authenticate end-users step-by-step.
August 8, 2019
· 7,964 Views · 1 Like
article thumbnail
Uploading and Downloading Files: Streaming in Node.js
In this post, you'll learn how to stream files between clients, Node.js, and Oracle Database.
Updated July 2, 2019
· 37,720 Views · 5 Likes
article thumbnail
Uploading and Downloading Files: Buffering in Node.js
In this post, we'll learn how to perform file uploads and downloads using buffered binds and fetches.
Updated June 26, 2019
· 38,353 Views · 1 Like
article thumbnail
How to Interact With a Database Using Async Functions in Node.js
In the final post of the series on interacting with databases, we'll learn about async functions — the most exciting thing to happen to JavaScript since Ajax.
Updated April 5, 2019
· 181,693 Views · 11 Likes
article thumbnail
Relational to JSON With PL/SQL
Using JSON with Oracle has become much easier, but what if you need to do something that needed the use of PL/SQL's procedural features?
November 9, 2018
· 10,486 Views · 1 Like
article thumbnail
Creating a REST API Part 5: Manual Pagination, Sorting, and Filtering
In this post, you'll make the API more flexible by adding pagination, sorting, and filtering capabilities.
Updated August 20, 2018
· 76,047 Views · 7 Likes
article thumbnail
Creating a REST API Part 4: Handling POST, PUT and DELETE Requests
In this post, you will finish building out the basic CRUD functionality of the API by adding logic to handle POST, PUT, and DELETE requests on the employees endpoint.
April 13, 2018
· 181,505 Views · 7 Likes
article thumbnail
Creating a REST API With Node.js and Oracle Database
Get details on the target environment and an overview of the high-level components that I'll use to build a REST API to balance granular control and magical black boxes.
April 9, 2018
· 18,942 Views · 2 Likes
article thumbnail
Creating a REST API Part 3: Handling GET Requests
In this post, you will add routing, controller, and database logic to an app to handle an HTTP GET request on an 'employees' API endpoint.
April 9, 2018
· 22,057 Views · 3 Likes
article thumbnail
Creating a REST API Part 2: Database Basics
Learn how to create a module responsible for starting up and shutting down a DN connection pool and add a function that simplifies executing simple statements.
April 2, 2018
· 19,523 Views · 3 Likes
article thumbnail
Creating a REST API Part 1: Web Server Basics
We'll start our REST API project by creating some initial directories/ files, create a web server module and wire things up so that it starts up and shuts down correctly.
April 2, 2018
· 30,570 Views · 12 Likes
article thumbnail
Relational to JSON With Node.js
It's not exactly fair to compare a solution crafted in Node.js to the PL/SQL solutions... but whatever, let's compare them anyway!
Updated November 13, 2017
· 25,284 Views · 6 Likes
article thumbnail
Relational to JSON With ORDS
Learn about ORDS, basically acts as a middleman between clients (applications) and the database, mapping incoming HTTP(S) requests to resource handlers.
Updated November 13, 2017
· 14,033 Views · 4 Likes
article thumbnail
Authentication With Node.js, JWTs, and Oracle Database
Authentication is your first line of defense against cybercriminals. Read on to learn how to implement it in your web application.
November 13, 2017
· 7,850 Views · 5 Likes
article thumbnail
Real-Time Data With Node.js, Socket.IO, and Oracle Database
Originally, the only way to simulate real-time data in web apps was via some sort of polling from the browser to the web server. Learn how to push changes from Oracle Database to the web server.
November 13, 2017
· 10,221 Views · 4 Likes
article thumbnail
An Overview of Result Sets in the Node.js Driver
I highly recommend using result sets as the default means through which you execute queries with the Node.js driver. Read on to see why.
November 10, 2017
· 14,753 Views · 1 Like
article thumbnail
Working With Dates Using the Node.js Driver
This post explores the conversion process for converting data to be native on JavaScript and Oracle, for datetime values in particular.
October 25, 2017
· 31,607 Views · 4 Likes
article thumbnail
Working With Dates in JavaScript, JSON, and Oracle Database
Learn about dates in the context of JavaScript, JSON, and Oracle Database based on a RESTful API scenario.
Updated October 23, 2017
· 24,031 Views · 1 Like
article thumbnail
Relational to JSON With APEX_JSON
APEX_JSON was primarily intended to be used by APEX developers — but there are some hooks that can allow it to be used as a standalone PL/SQL package.
October 20, 2017
· 9,287 Views · 1 Like
article thumbnail
How to Interact With a Database Using Promises in Node.js
Understanding promises is essential to understanding async functions. Learn the basics of promises and demonstrate how they can be used to construct asynchronous apps.
August 2, 2017
· 67,366 Views · 5 Likes
article thumbnail
How to Interact With a Database Using Callbacks in Node.js
Callback functions have been around for a while, but there have never been any standards for using them — leading to variations in API implementations.
July 23, 2017
· 34,639 Views · 4 Likes
article thumbnail
How to Interact With a Database Using Various async Patterns in Node.js
Get a little context on how async programming is different than traditional programming. It's not as easy as it may first seem.
July 20, 2017
· 8,623 Views · 3 Likes

Comments

How to Interact With a Database Using Async Functions in Node.js

Apr 04, 2019 · Dan McGhan

It seems like something wasn't copied over from the source correctly. I added the missing code. If you find something else missing, check out the original post here: https://jsao.io/2017/07/how-to-get-use-and-close-a-db-connection-using-async-functions/

How to Interact With a Database Using Promises in Node.js

Jul 10, 2018 · Dan McGhan

Here's a gist to show you how it could work.

How to Interact With a Database Using Callbacks in Node.js

Jan 18, 2018 · Dan McGhan

The callback does not mean return. That's just a function, like any other, being invoked. When that happens a new function is added to the call stack and executed. When complete, the lines following that call will be executed (which is why we need to return).

Why not try running the code and experimenting with commenting the line out? Use this to get started: https://dzone.com/articles/creating-a-sandbox-for-learning-nodejs-and-oracle

How to Interact With a Database Using Callbacks in Node.js

Jan 18, 2018 · Dan McGhan

The return statement exits the function. Without that, the logic that follows the if statement would execute - but that logic assumes that a connection has been successfully obtained.

User has been successfully modified

Failed to modify user

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: