what will be the query for ms access table to update a specific row?
Code below is not making a valid result set resulting in exception?
need help
:-/

import java.sql.*;

class OdbcAccessQuery {
  public static void main(String [] args) {


       Connection con = null;
    try {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      con = DriverManager.getConnection("jdbc:odbc:WWFDB");
      Statement sta = con.createStatement();

// getting the data back
      ResultSet res = sta.executeQuery(

"UPDATE WWFTABLE SET NAME='sky' WHERE ID=5");

     
      res.close();

      sta.close();
      con.close();
    } catch (Exception e) {
      System.err.println("Exception: "+e.getMessage());
    }

  }
}

Use executeUpdate() instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.