This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes accessing database using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "accessing database using javascript" Watch "accessing database using javascript" New topic

accessing database using javascript

Krishna Acharya
Ranch Hand

Joined: Jun 05, 2007
Posts: 33
I have one drop down box(with some values) in a jsp page. I would like to access the database table and display on the jsp page using the selection from the drop down box. How can I do this ??? for hint: sql would be like: SELECT * FROM <table name> WHERE <column name>=<value selected from drop down box>.

Thanks so much to you who is giving me answer. Please...
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60752

You can't.

You'll need to go back to the server to execute the JDBC (or other database access) code there.

One convenient way to do with without having to submit the whole page is with Ajax.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: accessing database using javascript
Similar Threads
populating textarea from dropdown box selection
onChange Event to call a frame.
decreasing width of drop down box
Drop down box issue
show and insert data from list depending on choice of radio button