My SQL is like this ::
UPDATE tbl_Bus SET Bus_locX= 520.0,Bus_locY=220.0 WHERE Bus_ID=1
This statement does not update my table though it's working fine when I am using it directly in sql editor in MS Access.
My tbl_Bus
Bus_ID,Bus_LocX,Bus_LocY,Bus_RouteID
and the corresponding data are 1,1,1,1 even after running my app..
My codes
Expand|Select|Wrap|Line Numbers
- 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;
- }
- }
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?