你能告诉我如何获得最后的访问时间吗?到目前为止,当我尝试获取它时,它会返回null
用户名。
这是JSP中的代码:
<%
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/lportal", "root", "root");
Statement statement = connection.createStatement();
String username = request.getParameter("username");
ResultSet resultset =
statement.executeQuery("select lastmodified from ams1 where username = '" + username + "'") ;
System.out.println(username);
%>
<% while(resultset.next()){ %>
<p> last punchin: <%= resultset.getString(1) %> </p>
<% } %>