473,473 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to connect to oracle database from JavaScript?

8 New Member
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 10328
Dormilich
8,658 Recognized Expert Moderator Expert
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.