469,319 Members | 2,415 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

database connectivity using javascript

hi
can i connect database using (client side )javascript. pls send me a sample code.

so that it would be very much helpfull.
May 18 '07 #1
8 6095
dmjpro
2,476 2GB
that means u don't want to submit the page. ..... right !!!!!!!!!!

using JS it is not possible to connnect with server side Database.
it is only possible with server side languages.
so now Q. is that how can u get response without submitting the page.
now ... a grate think u r going to learn ..... AJAX will answer ur Q.

plz try to search GOOGLE ... AJAX.
best of luck with ur new horizons.

kind regards.
dmjpro.
May 18 '07 #2
that means u don't want to submit the page. ..... right !!!!!!!!!!

using JS it is not possible to connnect with server side Database.
it is only possible with server side languages.
so now Q. is that how can u get response without submitting the page.
now ... a grate think u r going to learn ..... AJAX will answer ur Q.

plz try to search GOOGLE ... AJAX.
best of luck with ur new horizons.

kind regards.
dmjpro.


i want client side database connectivity using JS is it possible .pls suggest me in this regard

with regards and thanks
cvijaykrishna
May 21 '07 #3
dmjpro
2,476 2GB
without sending the request how can u get the database connectivity?????

is it possible?? first tell me.

kind regards.
dmjpro.
May 21 '07 #4
acoder
16,027 Expert Mod 8TB
i want client side database connectivity using JS is it possible .pls suggest me in this regard
You can achieve this using AJAX as suggested by dmjpro. The database connectivity is via a server-side language, but it seems that everything is done client-side because the page is not refreshed. You can use javascript to make the request, the server-side language (ASP, PHP, Coldfusion, JSP, etc.) returns the response which you can deal with client-side.
May 21 '07 #5
thank u very much for your guidence,i will see in that field.
with regards and thanks
vijay
May 22 '07 #6
r035198x
13,262 8TB
i want client side database connectivity using JS is it possible .pls suggest me in this regard

with regards and thanks
cvijaykrishna
Client side database connectivity with Javascript is not possible. You connect to the database using a server side scripting language. You can use Ajax to try and fool the user that you are connecting to the database using Javascript but all you will be doing is connecting to a server side script without the user realizing that that's what you are doing.
May 22 '07 #7
acoder
16,027 Expert Mod 8TB
aliasgerraj, you posted this via the Report button/link:
how i can connect SQL database in client side by ajax or java script and fill select by this
Please use the Reply button instead. Thank you.
May 31 '08 #8
acoder
16,027 Expert Mod 8TB
how i can connect SQL database in client side by ajax or java script and fill select by this
To answer your question, even though it's already been answered in this thread, JavaScript cannot access or connect to the database. You would need server-side code for this. Make a request to the server-side script which would return a response which you can use on the client-side. See an example (replace the ASP with the language of your choice). To fill the select element, either return the HTML and set the innerHTML to that, or return JSON or XML which can be parsed to get the data.
May 31 '08 #9

Post your reply

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

Similar topics

3 posts views Thread by Niks | last post: by
3 posts views Thread by Martin B | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.