I had this posted in the javascript forum because it's part of my javascript program, but someone replied to say that it's java code(?). I know response.sendRedirect is javascript, but I'm new at this so any help will do.
This is the code I have, but I haven't incorporated the record not found check in properly. How should it be done?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
;
Connection conn = DriverManager.getConnection("jdbc
dbc
octorLookUp","",""
;
Statement stat = conn.createStatement();
rs = stat.executeQuery("Select first_name, middle_initial, last_name, phone_number from Doctors Where attending_physician_id='"+physician_id+"'"
;
if not found then raise exception '' doctor id not found, re-enter id '', doctors;
msg = "Physician%20Id%20not%20found%20in%20the%20doctors%20database,%20please%20re-enter";
response.sendRedirect("/examples/jsp/DocDelete1.jsp?msg="+msg);
end if;
while(rs.next()){
att_physician_id=physician_id;
firstname=rs.getString("first_name"
;
middleinitial=rs.getString("middle_initial"
;
lastname=rs.getString("last_name"
;
phonenumber=rs.getString("phone_number"
;
This is the code I have, but I haven't incorporated the record not found check in properly. How should it be done?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
Connection conn = DriverManager.getConnection("jdbc
Statement stat = conn.createStatement();
rs = stat.executeQuery("Select first_name, middle_initial, last_name, phone_number from Doctors Where attending_physician_id='"+physician_id+"'"
if not found then raise exception '' doctor id not found, re-enter id '', doctors;
msg = "Physician%20Id%20not%20found%20in%20the%20doctors%20database,%20please%20re-enter";
response.sendRedirect("/examples/jsp/DocDelete1.jsp?msg="+msg);
end if;
while(rs.next()){
att_physician_id=physician_id;
firstname=rs.getString("first_name"
middleinitial=rs.getString("middle_initial"
lastname=rs.getString("last_name"
phonenumber=rs.getString("phone_number"