for your information, i'm using
jsp to create my web page. i am inserting sequence number into the database. When first data in insert into database it will show number 1 in the database. when second data in insert in database, it will show number 2 in the database. the data are inserted when user click submit button from the web page.
i am creating a page name main.jsp. when the user select option from the list bar, it will link to new page. the option value in the list bar are 'sentul view' and 'cityview'. if the user choose 'cityview', it will link to new page that allows user to key in their information. the problem is sequence number was enter wrongly into database. when the first user click submit after selected "city view', sequence in 'cityview' database will increase. then when the other user register 'sentul view', the database sequence will start from number 2 in 'sentul view' database. how to avoid the problem...
i enclosed some part of the code:
<%
String sql_selectMax = "SELECT max(smb_regr_seq_no) as maxNo "+
"FROM smbyer ";
Statement stmt_selectMax = conn.createStatement();
ResultSet rset_selectMax = stmt_selectMax.executeQuery(sql_selectMax);
while(rset_selectMax.next()){
reqNo = rset_selectMax.getInt("maxNo");
out.print (reqNo);
}
reqNo = reqNo + 1;
%>