package ee.tpu.hk.links; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; /** * Klass HTML-i juppide hoidmideks ja töötlemiseks. * 2003 Haapsalu Kolledz * @author Berit Hiieväli */ public class func { private db dbConn = new db(); // html lehe päis public String header = ""+ "
\n"+ "\n"+ "
\n"+ " Artist | \n"+ "\n"+ " Pealkiri | \n"+ "\n"+ " Stiil | \n"+ "\n"+ " Aasta | \n"+ "Kommentaar | \n"+ "Muuda | \n"+ "Kustuta | \n"; try { int ci =0; String color ="#D5F0FD"; if (orderBy == null) orderBy ="artist"; String lause ="SELECT id, artist, title , zanr , aasta, comm FROM `plaadid` WHERE `user_id` = "+userId+" ORDER BY `"+orderBy+"` ASC "; ResultSet rs1 = dbConn.executeQuery(lause); int row_id =0; while(rs1.next()) { if(ci == 0) { color ="#D5F0FD"; ci = 1; }else{ color ="#E2E2E2"; ci = 0; } row_id =rs1.getInt("id"); table += "
"+ rs1.getString("artist").trim() +" | \n"+ ""+ rs1.getString("title") +" | \n"+ ""+ rs1.getString("zanr") +" | \n"+ ""+rs1.getInt("aasta") +" | \n"+ ""+ rs1.getObject("comm").toString() +" | \n"+ "muuda | \n"+ "kustuta | \n"; } }catch (Exception e){System.out.println(e);} table +="