Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

DB connectivity with javascript?

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone!

Can i do database connectivity using javascript?if yes how?...and if no then why?

Thanks a lot in advance
regards,
Ravissant
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not very sure. it depends upon where you are running the java script. if you are running javascript in server side you can connect to the database. this is possible in asp/iis but not in java. how to connect to database refer ASP documentation

But i think in java we cannot connect database using Java script. Because to connect to a database we need to load the database driver to the memory/runtime environment. but java script is running in script engine, i dont think script engine will allow to load the driver.
 
author & internet detective
Posts: 39959
804
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravissant,
I think no, but I'm not sure either. JavaScript usually runs in a browser which would have security issues from doing anything on the server side.

I'm going to move this to our HTML & JavaScript forum so you can get a more definitive answer.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use a serverside technology to connect to a database.

Eric
 
Ravissant Markenday
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Baiju, Jeanne, Eric!
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ravissant,

You can use Javascript to call serverside technology (we call this Ajax), and this serverside-stuff can connect to your database.


Herman
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic