how can i update a mysql table using java?
<p>I tried this code to get connected to Mysql DB and can see the connectivity and my table rows but not able to update my table and see updated form of my table.Please help me...</p>

<pre><code> import java.sql.*;
    public class MySqlQuery {
        public static void main(String[] args) {
            try{
                Class.forName("com.mysql.jdbc.Driver");
            } catch (ClassNotFoundException cn){
                System.out.println("Cannot load drivers");
            }
            Connection connect = null;
            try{
                connect = DriverManager.getConnection("jdbc:mysql://db-mysql/xyz","xyz","xyz"); 
            } catch (SQLException sq){
                System.out.println("Cannot get a connection");
            }
            try{
                Statement stat = connect.createStatement();
                ResultSet myResult = stat.executeQuery("select*from table");
                while (myResult.next()){
                    System.out.println("id is"+ myResult.getString(1));             

                }
            } catch (SQLException s){
                System.out.println("error in query");

            }
        }
    }
</code></pre>
