{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Vandana Kumari · Aug 30, 2020 at 03:45 PM · 107 Views database connectivity

How to connect to JDBC database in APIGEE to execute queries?

Hi,

I have a requirement where when an API request comes to Apigee, it connects to JDBC and executes database queries to save and retrieve the OTP. What is the process to connect to JDBC database and execute query in Apigee?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Priyadarshi Ajitav Jena · Aug 31, 2020 at 05:38 AM

Connecting to database from Apigee for querying is not a good idea. You can use one web service to do that for you and Apigee will call to the web service.

Else you can use java callout to connect. But this will make Apigee proxy overloaded.

Comment
Add comment Show 2 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pravin Ingawale · Jan 12 at 05:34 PM 0
Link

Hi

I am trying to connect to Oracle DB using Node.js and using code below but it is not working




process.env.ORA_SDTZ = 'UTC'; const oracledb = require('oracledb'); const dbConfig = require('./dbconfig.js'); async function run() { let connection; try { let sql, binds, options, result; connection = await oracledb.getConnection(dbConfig); // // Create a table // const stmts = [ `DROP TABLE no_example`, `CREATE TABLE no_example (id NUMBER, data VARCHAR2(20))` ]; for (const s of stmts) { try { await connection.execute(s); } catch(e) { if (e.errorNum != 942) console.error(e); } } // // Insert three rows // sql = `INSERT INTO no_example VALUES (:1, :2)`; binds = [ [101, "Alpha" ], [102, "Beta" ], [103, "Gamma" ] ]; // For a complete list of options see the documentation. options = { autoCommit: true, // batchErrors: true, // continue processing even if there are data errors bindDefs: [ { type: oracledb.NUMBER }, { type: oracledb.STRING, maxSize: 20 } ] }; result = await connection.executeMany(sql, binds, options); console.log("Number of rows inserted:", result.rowsAffected); // // Query the data // sql = `SELECT * FROM no_example`; binds = {}; // For a complete list of options see the documentation. options = { outFormat: oracledb.OUT_FORMAT_OBJECT, // query result format // extendedMetaData: true, // get extra metadata // prefetchRows: 100, // internal buffer allocation size for tuning // fetchArraySize: 100 // internal buffer allocation size for tuning }; result = await connection.execute(sql, binds, options); console.log("Metadata: "); console.dir(result.metaData, { depth: null }); console.log("Query results: "); console.dir(result.rows, { depth: null }); // // Show the date. The value of ORA_SDTZ affects the output // sql = `SELECT TO_CHAR(CURRENT_DATE, 'DD-Mon-YYYY HH24:MI') AS CD FROM DUAL`; result = await connection.execute(sql, binds, options); console.log("Current date query results: "); console.log(result.rows[0]['CD']); } catch (err) { console.error(err); } finally { if (connection) { try { await connection.close(); } catch (err) { console.error(err); } } } } run();
avatar image Dino-at-Google ♦♦ Pravin Ingawale   · Jan 12 at 11:27 PM 0
Link

using Node.js running where, exactly?

Follow this Question

Answers Answers and Comments

72 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Java-callout data base connectivity question 1 Answer

How can I use a database synchronization function? 0 Answers

Can APIGEE fetch data from SAP or DBs (Stored procs) ? And, what sort of connectors/adapters are available out of the box. 1 Answer

How to connect to JDBC database in APIGEE to execute queries? 2 Answers

Why do I see a lot of connections on the message processors in CLOSE_WAIT state? 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges