📄 allfile.java
字号:
/*
* Created on 2006-9-24
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.skyhawk.selffile;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skyhawk.db.ConnectionFactory;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class allfile {
public void execute(HttpServletRequest request,HttpServletResponse response){
Connection conn=ConnectionFactory.getConnection();
Statement stmt=null;
ResultSet rs=null;
try {
stmt=conn.createStatement() ;
String all="select * from o_myfile where userid='"+request.getParameter("userid")+"'";
rs=stmt.executeQuery( all);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ArrayList list=new ArrayList();
try {
while(rs.next()){
String filename=rs.getString("name");
String id=rs.getString("password");
File file=new File();
file.setFileName(filename);
file.setUserId(id);
list.add(file);
}
request.setAttribute("list",list);
request.getRequestDispatcher("/selectAll.jsp").forward(request,response);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (ServletException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -