473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to connect to oracle database from JavaScript?

8
hi

i have databasse oracle i want to connected with javascript for handling query.
Expand|Select|Wrap|Line Numbers
  1. // information for my dababase 
  2.   Class.forName("oracle.jdbc.OracleDriver");
  3.   String url="jdbc:oracle:thin:@localhost:1521:orcl";
  4.       c=DriverManager.getConnection(url, "hr", "ntic");

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.  var oracle = require('oracle');
  4. var connectData = {
  5.     hostname: "localhost",
  6.     port: 1521,
  7.     database: "orcl", // System ID (SID)
  8.     user: "hr",
  9.     password: "ntic"
  10.  
  11.     };
  12.     oracle.connect(connectData, function(err, connection) {
  13.  
  14.     if (err) { console.log("Error connecting to db:", err); return; }
  15.     connection.execute("SELECT systimestamp FROM dual", [], function(err, results) {
  16.         if (err) { console.log("Error executing query:", err); return; }
  17.  
  18.         console.log(results);
  19.         connection.close(); // call only when query is finished executing
  20.     });
  21. });
  22.         </script>
i do this but no worked

thansk
Apr 24 '15 #1
1 10312
Dormilich
8,658 Expert Mod 8TB
what exactly does not work?
Apr 24 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Yanick Quirion | last post by:
Hi all, I'm trying to find a simple code to connect to an Oracle Database (9i) with C under linux. I have a script that read a form from the web and I want to access my Oracle database with...
2
by: baumann.Pan | last post by:
Dear all , how can I connect to oracle database in C language under linux? thanks in advance
1
by: Hai Ly Hoang \(MT00KSTN\) | last post by:
Hi, I'm an Oracle newbie. I've just created a table in Oracle with CREATE TABLE. Now, in C#, how to connect to database and get my table ? Thanks
0
by: Asheesh | last post by:
Hi, I want to configure client machine with oracle database server thru .Net programming. Can any body tell me how? Actually the scenario is: I am crating .net setup project for complete...
1
by: renjith.nair | last post by:
Please give me some sample codes to connect oracle database from a java program.
10
by: Reedsp | last post by:
Version: MSAccess 2003 SP2 Explination: I have a database that connects to an oracle database. I have setup an ODBC connection under the System DSN tab in the ODBC Source Administrator. The...
3
by: nasirVB | last post by:
I am trying to develop a database management system with oracle. But i dont know coding for the same. I have been using MS Access as database. But i want o switch the database to Oracle. Please help...
6
by: mktselvan | last post by:
hi here we have oracle financial system (dbtier, applicatin tier) @ sun solaris sparc from windows client, application tier ip address is working (pinging from remote area) but dbtier...
3
by: techquest | last post by:
Hi, I want to connect into oracle database and export the table data into a flat file using UNIX shell scripts. I cant use other GUI tools to do this, as the dataload will be in millions. hence if...
0
by: akshalika | last post by:
I am new to Biztalk. In my project we need to connect oracle database and insert data into oracle table using BizTalk project. I use WCF Adapter pack(SP2). I create biztalk project then using Consume...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.