// 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("Lingikataloog |
");
out.println("");
out.println("");
out.println("Lingi nimi | Aadress | Hinda saiti | Statistika | ");
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("" + link + " | " + aadress + " | 1|2|3|4|5 | Vaata... | ");
}
cn.close();
out.println(" ");
out.println(" |
");
out.println("Lisa link |
");
if(kysimus.getParameter("action").equals("lisa")){
out.println("Saidi nimi | Saidi aadress |
");
out.println("");
}
out.println("
");
out.println("");
out.println("");
}catch (Exception viga){viga.printStackTrace();}
}
}