-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServ_AddFolder.java
executable file
·57 lines (48 loc) · 2 KB
/
Serv_AddFolder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: Serv_AddFolder.java
import java.io.IOException;
import java.io.PrintStream;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import connect.ConnectionProvider;
public class Serv_AddFolder extends HttpServlet
{
public Serv_AddFolder()
{
}
public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException, IOException
{
try
{
// Class.forName("oracle.jdbc.driver.OracleDriver");
// con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "ojasvi");
con=ConnectionProvider.getConnection();
st = con.createStatement();
scon = getServletContext();
HttpSession httpsession = httpservletrequest.getSession(true);
uname = httpsession.getValue("name").toString();
newf = httpservletrequest.getParameter("fname");
httpsession.putValue("foldername", newf);
String s = httpsession.getValue("foldername").toString();
System.out.println("newf: " + s);
ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
int i = st.executeUpdate("insert into folders values('" + uname + "','" + newf + "')");
System.out.println("i:" + i);
servletoutputstream.println("<html><body bgcolor=white background='INDTEXTB.JPG' text=blue><h2><i>Folder " + newf + " Created Successfully</i></h2></body></html>");
httpservletresponse.setHeader("Refresh", "2;URL='Serv_Inbox'");
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
Statement st;
Connection con;
ServletContext scon;
String uname;
String newf;
}