try {
//1.Load the database Driver class
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//2.Make a connection to the database
Connection conn = DriverManager.getConnection(
"jdbc:odbc:MyDataSource");
Statement stmt = conn.createStatement();
String x = jTextField1.getText().toString();
String sqll ="UPDATE Patient_Comp SET taken='Taken'WHERE ID="+x ;
ResultSet rs = stmt.executeQuery(sqll);
This is what i wrote to update a instance of a column, but i am getting exceptions.. i am not sure if executeQuery
is the correct attribute. will some one please provide me with the working code ..