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 7741347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:00:13+00:00 2026-06-01T09:00:13+00:00

Currently i’m writing a JDBC application to manage a MySQL database. I have the

  • 0

Currently i’m writing a JDBC application to manage a MySQL database. I have the delete, insert and select methods functioning with the correct queries. I’m having trouble with the Update method. When using using the following code I receive a MySQL error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near “”,Street”,Town”,City”,PostCode”,Age”,email”,RunningFee’false’Where PID=” at line 1…

private void updateData()
{
    Connection con;
    try
    {
        Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection(
                "jdbc:mysql://localhost/snr","root","");

        String sql = "Update participant Set password='"+txtpassword.getText()+"'," +
                "lastName='"+txtlastName.getText()+"',firstName='"+
                txtfirstName.getText()+"',HouseNumber'"+txtHouseNumber.getText()+"',Street'"+txtStreet.getText()+"',Town'"+txtTown.getText()+"',City'"+txtCity.getText()+"',PostCode'"+txtPostCode.getText()+"',Age'"+txtAge.getText()+"',email'"+txtemail.getText()+"',RunningFee'"+cbRunningFee.isSelected()+"' Where PID='"+txtPID.getText()+"'";

        Statement statement = con.createStatement();

        statement.execute(sql);

        createMessageBox("Updated Successfully");

        clearControls();
    }
    catch(Exception e)
    {
        createMessageBox(e.getMessage());
    }
}

Is there something wrong with my SQL 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-01T09:00:15+00:00Added an answer on June 1, 2026 at 9:00 am

    Yes, your query is wrong. You’re missing = on a great big bunch of set column/value pairs.

    (And please consider using prepared statements and bind variables, SQL injection is just not something you want to be open to.)

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

Sidebar

Related Questions

Currently I have a DetailsView attached to a GridView. When you select an item
Currently, I have a log file of messages in one table in a MySQL
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
currently we have quite a chunky auditing system for objects within our application, the
Currently I have a class that looks like this: public class MyClass : IMyClass
Currently developing an application using the newest version of symfony, obtained through PEAR. This
Currently I'm prototyping search with Lucene.Net-2.0-004 on a web application. It's working very well,
Currently, I have something like: public partial class Form1 : Form { delegate void
Currently, I have: <html> <div class=yes1><span><img src=img></span></div> </html> <script> var x = ='yes1' var
currently we have a column with only integer values declared as NUMBER. At the

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.