<%@ page import="java.sql.*" %>
Registrinr:
Mark:
<% Class.forName("org.gjt.mm.mysql.Driver"); Connection cn=DriverManager.getConnection( "jdbc:mysql://greeny.cs.tlu.ee/if14_jaagup_a", "if14", "ifikas2014"); Statement st=cn.createStatement(); String sorttulp="mark"; if(request.getParameter("sort")!=null && request.getParameter("sort").equals("regnr")){ sorttulp="regnr"; } ResultSet rs=st.executeQuery("SELECT regnr, mark FROM autod ORDER BY "+sorttulp); while(rs.next()){ if(request.getParameter("muutmisregnr")!=null && request.getParameter("muutmisregnr").equals(rs.getString("regnr"))){ %> <% } else { out.println(""+ ""+ ""); } } %>
Haldus Registrinumber Mark
" /> <%=rs.getString("regnr") %> " />
m "+ "x"+rs.getString("regnr")+""+ rs.getString("mark")+"