教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 政务民生 >

hadoop网盘环境搭建,代码全部过程(7)

来源:网络收集 时间:2026-08-21
导读: 用户名 手机号 邮箱 密码 修改信息 修改邮箱 修改密码 更换绑定手机号 更多 网盘 FileStatus[] list = (FileStatus[])request.getAttribute(\); %> 文件 31 / 53 文件名 属性 大小 删除 下载 String path=null; pat

用户名 手机号 邮箱 密码

修改信息

修改邮箱 修改密码 更换绑定手机号 更多

网盘

<%

FileStatus[] list = (FileStatus[])request.getAttribute(\); %>

文件

31 / 53

文件名 属性 大小 删除 下载

<%

String path=null;

path=list[0].getPath().toString().substring(18,list[0].getPath().toString().length()-list[0].getPath().

if(list != null)

for (int i=0; i

%>

<% %>

<%= (list[i].isDir()?\目录\:\文件\) %> <%= list[i].getLen()/1024%>

32 / 53

getName().toString().length()).toString();

if(list[i].isDir()) {

out.print(\

href=\\\+list[i].getPath()+\+list[i].getPath().getName()+\);

}else{ }

out.print(\+list[i].getPath().getName()+\);

g(),\) %>&mypath=<%=list[i].getPath().toString().substring(18,list[i].getPath().toString().length()-list[i].getPath().getName().toString().length()).toString()%>\>

g(),\) %>&mypath=<%=list[i].getPath().toString().substring(18,list[i].getPath().toString().length()-list[i].getPath().getName().toString().length()).toString()%>\>下载

二、数据交互 数据库连接: publicclass ConnDB { }

检测用户登录是否合法: public class UserBeanCl {

private Connection ct = null; public Connection getConn(){ try { //加载驱动

Class.forName(\);

//得到连接 ct =

} catch (Exception e) {

// TODO Auto-generated catch block e.printStackTrace(); } returnct; }

DriverManager.getConnection(\);

private Statement sm = null; private Connection ct = null; private ResultSet rs = null; public void close(){

try {

if(sm != null){ }

if(ct != null){ }

if(rs != null){ }

34 / 53

sm.close(); sm = null;

ct.close(); ct = null;

rs.close(); rs = null;

}

}

}

catch (SQLException e) { }

// TODO Auto-generated catch block e.printStackTrace();

//检查登录用户是否合法

public boolean checkUser(String user, String password){ }

boolean b = false; try { //获得连接 } return b;

ct = new ConnDB().getConn(); //创建statement sm = ct.createStatement();

rs = sm.executeQuery(\if(rs.next()){ }

//说明用户存在

String pwd = rs.getString(3); if(password.equals(pwd)){ } b = false;

//说明密码正确 b = true; b = false;

}else{

}else{

} catch (SQLException e) {

e.printStackTrace(); this.close(); }finally{

用户注册部分与数据库的交互主要代码:

publicbooleancreateUser(String id,String user, String password,String emal) throws SQLException{

booleanb = false;

35 / 53

hadoop网盘环境搭建,代码全部过程(7).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/448558.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)