title: Why data in my table cannot be not updated?
body: <p>I want to update data from my database using java. I have established my connection successfully and When I am updating the table,the data is not updated in the database.</p>
  
  <p>My SQL is like this ::</p>
  
  <pre><code>UPDATE  tbl_Bus SET Bus_locX= 520.0,Bus_locY=220.0 WHERE Bus_ID=1
  </code></pre>
  
  <p>This statement does not update my table though it's working fine when I am using it directly in sql editor in MS Access.</p>
  
  <p>My tbl_Bus</p>
  
  <pre><code>Bus_ID,Bus_LocX,Bus_LocY,Bus_RouteID
  </code></pre>
  
  <p>and the corresponding data are 1,1,1,1 even after running my app..</p>
  
  <p>My codes </p>
  
  <pre><code>public boolean update_busLoc(double x,double y,int id)
  {
      String query="UPDATE  tbl_Bus SET Bus_locX= "+ x +",Bus_locY="+y + " WHERE Bus_ID="+id;
      System .out.println(query);
      if (DB_connection!=null){
              try{
                       statement.execute(query);
                       return true;
  
                   }
              catch(SQLException e){
                      e.printStackTrace();
                  return false;
              }
      }
      else{
          System.out.println("Connection is not set up");
          return false;
      }
  
  }
  </code></pre>
  
  <p>I use MS Access 2007
  I am able to execute SELECT statements and it is working fine but with update I am having problems..
  How do I sort this out?</p>