Solved

jquery or javascript reading database

Posted on 2012-03-20
2
255 Views
Last Modified: 2012-03-20
Hello. I have code in jquery which reads a remote database. I am worried about what could happen if that database for some reason goes down. I was wondering if there is a way to switch to another database if the read from the first one fails? Is there some way to know if the read fails?
Thanks.
0
Comment
Question by:onyourmark
2 Comments
 
LVL 13

Accepted Solution

by:
ansudhindra earned 500 total points
ID: 37745736
As far as I know, jQuery or javascript cannot access database. Server side programming is necessary to connect to database (like asp, jsp, php or coldfusion etc.).

jQuery may trigger an ajax call (or a browser request) to the server which inturn talks to database and returns data.

You can switch to another database if the read form one database fails.
a. check connection for first database, if it fails connect to second database
b. If first database connects and read returns 0 records from database,  connect to 2nd database and read.
you can also use try catch blocks in your server side coding to achieve the same.
0
 

Author Closing Comment

by:onyourmark
ID: 37745769
Thanks. I meant a jquery ajax call.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending E-mail ASP.Net 3 55
Basic JavaScript Question 3 37
Why does my button disappear? 3 26
Change text to radio button and calendar form 2 32
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now