I want to make an update page that lists records where I can click on the record link and edit the record. I have the Record viewing page set up and working where it shows the links but now when I click on the record link to get an update page it shows the correct argument ID in URL but the update page doesnt show the record. Here is what I have:
Record viewing page:
Code:
<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<% Connection connection = DriverManager.getConnection("jdbc:odbc:theDSN", "", "");
Statement statement = connection.createStatement();
ResultSet resultset = null;
resultset = statement.executeQuery("select * from tableOne");
%>
<%
while(resultset.next())
{
%>
<a href="updater.jsp?NameID=<%= resultset.getString("NameID") %>">
edit</A><br>
<%
}
%>
updater.jsp
Code:
<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<% Connection connection = DriverManager.getConnection("jdbc:odbc:theDSN", "", "");
Statement statement = connection.createStatement();
String myID = request.getParameter("NameID");
ResultSet resultset = statement.executeQuery("select * from tableOne where NameID like '" + myID + "'");
%>
<% while(resultset.next())
{
%>
<%= resultset.getString("NameID") %><br>
<% } %>
<%
resultset.close();
connection.close();
%>
The NameID value does not show up on the action page.
Please advise.