JDBC updatable ResultSet help!
Hi everyone. I'm using JDBC to write a class in Java that connects to a mySQL database (through the Connector/J driver). When I try to execute the code below it throws an exception that my ResultSet in not updatable. I understand that this might have to do with setting the Primary Key, etc. but I'm not sure how to do this in Java. Any help would be greatly appreciated!
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
element = srs.getString(field);
System.err.println("SQLState: " + ex.getSQLState());
System.err.println("Message: " + ex.getMessage());
System.err.println("Vendor: " + ex.getErrorCode());}
I'm guessing that srs is your ResultSet, here...the problem probably lies in this: Don't forget to do an executeQuery before trying to use a ResultSet. For example
srs = stmt.executeQuery("select........");
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center