📄 jcy_ry_ryzp.jsp
字号:
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import=" javax.servlet.http.*"%>
<%@ page import="javax.sql.DataSource"%>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import = "com.vstsoft.std.*" %>
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
<jsp:useBean id="jcypurview" class="com.vstsoft.jcypurview" scope = "session" />
<%
String currusercode = jcypurview.getUsercode(); //取当前用户usercode
String curruserid = jcypurview.getUserid(); //取当前用户编号
String currusername = jcypurview.getUserName(); //取当前用户名称
String curruserszqx = jcypurview.getUserSzqx(); //取当前用户所在区县
String curruserszdw = jcypurview.getUserSzdw(); //取当前用户所在单位
//检测用户是否登录
if (jcypurview.checkLogin() == false)
{
%>
<Script Language=javascript>
alert("用户已断线或未正常登录,请重新登录!")
window.open("../index.htm","_top")
</Script>
<%
return;}
%>
<%
//检测用户是否有操作权限
if (!(jcypurview.purviewVerdict("B0500001") || jcypurview.purviewVerdict("B0500002") || jcypurview.purviewVerdict("B0500003") || jcypurview.purviewVerdict("B0500009") || jcypurview.purviewVerdict("B0500010") || jcypurview.purviewVerdict("B0500035") || jcypurview.purviewVerdict("B0500036") || jcypurview.purviewVerdict("B0500037") || jcypurview.purviewVerdict("B0500038") || jcypurview.purviewVerdict("B0500043")))
{
%>
<Script Language=javascript>
alert("您没有操作此页权限!")
history.go(-1);
</Script>
<% return;
}
%>
<%
String uid = request.getParameter("uid");
Context ctx = null;
DataSource ds = null;
Connection con = null;
Statement stmt = null;
try {
ctx = new InitialContext();
ds = (DataSource)ctx.lookup("jc");
try{
con = ds.getConnection();
stmt= con.createStatement();
}catch(SQLException ex){
System.out.println(ex);
}
if (uid !=null) {
//取图片显示
try{
response.reset();
response.setContentType("image/jpeg");
OutputStream op = response.getOutputStream();
String sql="SELECT * FROM JCY_RYZP WHERE USERID='"+uid+"'";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
InputStream is = null;
is = rs.getBinaryStream("zp");
int total = 0;
int nread = 0;
byte[] buffer = new byte[4 * 1024];
while((nread = is.read(buffer)) != -1) {
op.write(buffer, 0, nread);
total += nread;
}
op.flush();
op.close();
}
rs.close();
stmt.close();
con.close();
}
catch (Exception e) {
System.out.println(e.toString());
}
}
}catch(Exception e){System.out.println(e);}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -