Author:
otherlight
Description: Java example #1
Language: Java
DataBase db;
ResultSet rs;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String res3 = "<html>";
res3 += "<head>";
res3 += "<title></title>";
res3 += "<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>";
res3 += "</head>";
res3 += "<body>";
String login = request.getParameter("login");
String new_theme = request.getParameter("new_theme");
PrintWriter out = response.getWriter();
db = new DataBase();
if (login != "" && new_theme != "")
{
db.DoSQLQuery("INSERT INTO theme SET name='"+new_theme+"',id_person=(select id from person where login='"+login+"')");
res3 += "Theme was added successful<br>";
res3 += "Close this window<br>";
}
else
{
res3 += "You didn't input theme's name<br>";
}
out.println(res3);
}
|
Recent pastes:
blessmaster (PHP)
antonivanov (SQL)
antonivanov (PHP)
brinza (PHP)
ilyhamas (Delphi)
Riateche (PHP)
otherlight (Java)
otherlight (JavaScript)
otherlight (CSS)
otherlight (CSS)
biophreak (JavaScript)
n4n (Perl)
prostoHz (Java)
ndubinkin (XML)
Riateche (Plain Text)
Slapotam (Perl)
ksurent (Perl)
John_Wein (Java)
John_Wein (HTML)
Riateche (HTML)
|