// Java Document import java.io.*; import java.sql.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class Baas extends HttpServlet { public void doGet(HttpServletRequest kysimus, HttpServletResponse vastus) throws IOException, ServletException { try{ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings",kysimus.getLocale()); vastus.setContentType("text/html"); PrintWriter out = vastus.getWriter(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:Baas1"); Statement st=cn.createStatement(); out.println(""); out.println(""); out.println(" Lingid "); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); if(kysimus.getParameter("action").equals("lisa")){ out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); } out.println("

Lingikataloog

"); out.println(""); out.println(""); String paring1 = "select * from Lingid"; ResultSet rs=st.executeQuery(paring1); while(rs.next()){ String id = rs.getString("id"); String aadress = rs.getString("aadress"); String link = rs.getString("Link"); out.println(""); } cn.close(); out.println("
Lingi nimiAadressHinda saitiStatistika
" + link + "" + aadress + "1|2|3|4|5Vaata...
"); out.println("
Lisa link
Saidi nimiSaidi aadress
"); out.println("
"); out.println(""); out.println(""); }catch (Exception viga){viga.printStackTrace();} } }