Statement st=c.createStatement();
and update commned
rs=st.executeQuery("SELECT max(ID) From Person");
int ID1=rs.getInt("ID");
System.out.print("ID: " + ID1);String statement1 ="UPDATE Person SET User_ID='HRD'+'"+ID1+"' where ID='"+ID1+"'";
PreparedStatement stmt1 = c.prepareStatement(statement1);
success = stmt1.executeUpdate();
Google Cloud SQL unofficial blog --- Google Cloud SQL is a fully-managed database service that makes it easy to set-up, maintain, manage and administer your relational MySQL databases
Saturday, June 30, 2012
ResultSet does not have a column ID or (1)
I am insert the record with auto incremented ID and one field User_ID update at the time of insert as the base max id in the ID value, at insert is execute and select also but the rs dnt have the column value rs=st.executeQuery("SELECT max(ID) From Person"); int ID1=rs.getInt("ID");so the result set show the ResultSet does not have a column ID why is show?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment