Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:31:41+00:00 2026-06-05T02:31:41+00:00

How Do I use javascript to connect and access values of database ? I

  • 0

How Do I use javascript to connect and access values of database ?
I want to register a user ,so when I am about to create user i want to check wheather username is available or not(means want to do search operation over database)?
can we do this with javascript? cause it is use for client side so I am confused?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:31:42+00:00Added an answer on June 5, 2026 at 2:31 am

    can we do this with javascript? cause it is use for client side so I am confused?

    JavaScript is a general-purpose programming language, not a client-side language. People use it server-side all the time.

    However, if you mean, can you use JavaScript in the web browser to access a database on your server, the answer is: Not directly, no (well, not unless you’re on an intranet and jump through hoops you really don’t want to jump through); you need a middle layer. You can have JavaScript on the client send messages to the server (via ajax, for instance); server-side code then needs to process those messages, ensure they’re valid and not malicious, and then very guardedly update the database and send back a result to the client browser.

    The server-side language can be JavaScript or any other language you want to use on the server. I notice you tagged your question jsp, so presumably you’d want to write the server-side stuff in Java (rather than JavaScript). If so, and if you want to use ajax so you have a modern, non-page-refresh experience, it looks something like this:

    1. User performs and action, raising an event in the browser.

    2. JavaScript code handles the event by sending an ajax message to the server; in the case of login, you probably want to do a POST.

    3. A JSP (or better yet, a servlet)

      1. Receives the POST message

      2. Validates the contents, checking for malicious content and other similar attacks

      3. Queries and/or updates the database using prepared statements and similar to avoid SQL injection attacks

      4. Sends the response, with information about the result of the operation

    4. The JavaScript code receives the response to the POST ajax call and looks at it to see what happened

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use JavaScript to get the username which is posted in the
I want to use javascript to generate 50 no-repeat random numbers and the number
I use the JavaScript SDK for Facebook Connect. Yesterday I loaded all the friends
We are new to rails and are looking to use the Javascript SDK Connect
I have a problem with Unicode char. What I want is connect to Access
I'm trying to use the 'edge.create' callback function of the Facebook javascript SDK to
Possible Duplicate: Remote Database access I'm developing an app for android which shoult connect
I'm attemping to use this code to call a php file, access the database,
I use Javascript. For example: sound = []; for (var i = 0; i
I use JavaScript for rendering 20 tables of 100 rows each. The data for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.