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

  • Home
  • SEARCH
  • 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 9304033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:37:08+00:00 2026-06-18T23:37:08+00:00

I have a general question regarding mysql queries and java. Can you take a

  • 0

I have a general question regarding mysql queries and java. Can you take a value that has been entered into a textbox by a user then assign that to a String, then in a whole separate class capture that String to fulfill the parameter in a mysql query. The mysql query would run and if the parameter is equal to the data in the table it will return a message of successful login etc. So I am asking for a yes or no style answer on this…any extra input would be helpful but not required. I know you can pass values from one class to another but in this instance I do wonder if it is possible in the running of a mysql query.

  • 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-18T23:37:09+00:00Added an answer on June 18, 2026 at 11:37 pm

    Of course it’s possible. How would we implement applications using a database if it weren’t:

    In GUI:

    String login = loginField.getText();
    boolean exists = userDao.checkUserExistence(login);
    
    ...
    

    In UserDAO:

    public boolean checkUserExistence(String login) {
        String sql = "select u.id from user u where u.login = ?";
        PreparedStatement stmt = connection.prepareStatement(sql);
        stmt.setString(1, login);
        ResultSet rs = stmt.executeQuery();
        return rs.next();
    }
    

    Note that the above is only pseudo-code. It doesn’t handle exceptions and doesn’t close resources properly. It’s just to give you an idea.

    Learn about prepared statements.

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

Sidebar

Related Questions

I have a general question regarding synchronized List. Lets say that in the constructor
I have a general question - regarding testing of values, I have run into
I have a simple, general question regarding a real small issue that bothers me:
I have a general question regarding Android's separation of layouts into layout.xml files: My
This is a very general question regarding GAE / Java Memcache : I have
I'm new to SharePoint and have a general question regarding list comparison. Currently, there
I have a very general question regarding the use of LINQ vs SQL to
I have a general question that is rather open-ended (i.e. depends on platform, application
I have a general question about the way that database indexing works, particularly in
I have a question regarding an ArrayList of Integers, or primitive types in general.

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.