package com.hb.bean;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;
public class DBO {
private String URL;
private String classname;
private String username;
private String password;
public static String sql1;
public static String sql2;
private CreatePage createpage = new CreatePage();
public static HashMap user = new HashMap();
public static HashMap meg=new HashMap();
public static HashMap buy_list=new HashMap();
public static Connection fetchConnection() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@localhost:1521:hb2008";
String username = "hb2008";
String password = "hb2008";
return DriverManager.getConnection(url, username, password);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static int addData(String str) {
Connection conn = null;
Statement sm = null;
int i = -1;
try {
conn = fetchConnection();
sm = conn.createStatement();
i = sm.executeUpdate(str);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return i;
}
public static int quaryData(String str) {
Connection conn = null;
Statement sm = null;
ResultSet rs=null;
int i = 0;
try {
conn = fetchConnection();
sm = conn.createStatement();
rs= sm.executeQuery(str);
while(rs.next()){
i++;
HashMap single=new HashMap();
single.put("object_id",rs.getString("object_id"));
single.put("ishave",rs.getString("ishave"));
single.put("object_number", rs.getString("object_number"));
buy_list.put(Integer.toString(i), single);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return i;
}
public static HashMap quaryLookcar(String str) {
HashMap buylist=new HashMap();
Connection conn = null;
Statement sm = null;
ResultSet rs=null;
int i = 0;
try {
conn = fetchConnection();
sm = conn.createStatement();
rs= sm.executeQuery(str);
while(rs.next()){
i++;
HashMap single=new HashMap();
single.put("object_id",rs.getString("OBJECT_ID"));
single.put("ishave",rs.getString("ISHAVE"));
single.put("object_number", rs.getString("object_number"));
single.put("object_price", rs.getString("object_price"));
single.put("object_name",rs.getString("object_name"));
buylist.put(Integer.toString(i), single);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try{rs.close();
}catch(SQLException e){
e.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return buylist;
}
public static boolean checkDownload(String str) {
Connection conn = null;
Statement sm = null;
ResultSet st = null;
boolean isreg = false;
int i = -1;
try {
conn = fetchConnection();
sm = conn.createStatement();
st = sm.executeQuery(str);
while (st.next()) {
isreg = true;
user.put("name", st.getString("username"));
user.put("sex", st.getString("usersex"));
user.put("QQ", st.getString("userqq"));
user.put("phone", st.getString("userphone"));
user.put("like", st.getString("userlike"));
user.put("pass", st.getString("userpass"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
st.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return isreg;
}
public static boolean checkBackDownload(String str) {
Connection conn = null;
Statement sm = null;
ResultSet st = null;
boolean isreg = false;
int i = -1;
try {
conn = fetchConnection();
sm = conn.createStatement();
st = sm.executeQuery(str);
while (st.next()) {
isreg = true;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
st.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return isreg;
}
public static String checkpass(String str) {
Connection conn = null;
Statement sm = null;
ResultSet st = null;
boolean isreg = false;
String password = null;
try {
conn = fetchConnection();
sm = conn.createStatement();
st = sm.executeQuery(str);
while (st.next()) {
password = st.getString("userpass");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
st.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return password;
}
public static String checkbackpass(String str) {
Connection conn = null;
Statement sm = null;
ResultSet st = null;
boolean isreg = false;
String password = null;
try {
conn = fetchConnection();
sm = conn.createStatement();
st = sm.executeQuery(str);
while (st.next()) {
password = st.getString("manager_password");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
st.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return password;
}
public static int doupdate (String str) throws NullPointerException{
Connection conn = null;
Statement sm = null;
int i = -1;
try {
conn = fetchConnection();
sm = conn.createStatement();
i = sm.executeUpdate(str);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return i;
}
public HashMap getCurrentList(int currentP) {
int i = 0;
String sql = "select * from tb_object order by id";
Connection conn = null;
Statement sm = null;
ResultSet rs = null;
try {
conn = fetchConnection();
sm = conn.createStatement();
rs = sm.executeQuery(sql);
while (rs.next()) {
i++;
HashMap single=new HashMap();
single.put("id",Integer.toString(rs.getInt("id")));
single.put("object_name",rs.getString("object_name"));
single.put("object_imgpath",rs.getString("object_imgpath"));
single.put("object_have",Integer.toString(rs.getInt("object_have")));
single.put("object_price",rs.getString("object_price"));
single.put("havebuy", "0");
meg.put(Integer.toString(i), single);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
rs.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
try {
sm.close();
} catch (SQLException e) {
e.printStackTrace();
}
try {
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
龙欣商城购物网站 本人毕设项目源代码 (127个子文件)
DBO.class 11KB
Update.class 4KB
PageLink.class 4KB
BackBussiness.class 4KB
Buy.class 4KB
Delete.class 4KB
chat.class 3KB
PayFor.class 3KB
UorD.class 3KB
PreIndex.class 3KB
LookCar.class 3KB
quary.class 3KB
CreatePage.class 2KB
CreatePage.class 2KB
ManagerSub.class 2KB
UpdateSub.class 2KB
.classpath 991B
style.css 2KB
main_04.gif 57KB
main_02.gif 50KB
main_01.gif 43KB
main_07.gif 26KB
message.gif 16KB
text.gif 15KB
end.gif 9KB
regpic.gif 8KB
title.gif 6KB
none.gif 5KB
logo.gif 5KB
bar.gif 4KB
bar1.gif 4KB
logo1.gif 3KB
menu_search.gif 2KB
menu_gift.gif 2KB
menu_zs.gif 2KB
menu_me.gif 2KB
menu_index.gif 2KB
menu_zx.gif 2KB
submit.gif 2KB
menu_help.gif 2KB
reset.gif 2KB
left_link.gif 1KB
menu_buy.gif 1KB
look_car.gif 1KB
quary.gif 1KB
button.gif 1KB
menu_line.gif 723B
pic.gif 178B
pic.gif 178B
point.gif 115B
classes12.jar 1.14MB
commons-fileupload-1.2.1-javadoc.jar 269KB
commons-io-1.3.2.jar 86KB
commons-fileupload-1.2.1-sources.jar 72KB
commons-fileupload-1.2.1.jar 56KB
jsmartcom_zh_CN.jar 13KB
SmartUpload.jar 9KB
jspsmart.jar 9KB
DBO.java 14KB
BackBussiness.java 5KB
PageLink.java 4KB
Update.java 4KB
Delete.java 4KB
Buy.java 4KB
UorD.java 3KB
PayFor.java 3KB
PreIndex.java 3KB
quary.java 3KB
chat.java 3KB
ManagerSub.java 2KB
UpdateSub.java 2KB
LookCar.java 2KB
CreatePage.java 2KB
main.jpg 135KB
back_left.jpg 25KB
manage_02.jpg 19KB
top.jpg 19KB
manage_03.jpg 19KB
manage_01.jpg 18KB
left.jpg 13KB
end.jpg 12KB
end.jpg 9KB
bar2.JPG 6KB
download.JPG 5KB
blue1.jpg 4KB
line.jpg 2KB
blue2.jpg 1KB
menu_line1.JPG 1KB
submit.jpg 1KB
border.jpg 673B
Updatemessage.jsp 9KB
reg.jsp 9KB
Newsub.jsp 6KB
uploadimpath.jsp 5KB
Updatepass.jsp 4KB
Download.jsp 4KB
gobuy.jsp 4KB
left.jsp 4KB
changebackpass.jsp 4KB
SubManager.jsp 4KB
共 127 条
- 1
- 2
资源评论
- ImButters2014-06-24感觉不太值十分。。不过还是感谢楼主了
- 满月风华一曲流觞2013-12-10不解释,只适合你本人
otzippo
- 粉丝: 12
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Python 版冒泡排序算法源代码
- tensorflow-gpu-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- tensorflow-2.7.3-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-2.7.2-cp39-cp39-manylinux2010-x86-64.whl
- Python版本快速排序源代码
- Python 语言版的快速排序算法实现
- 450815388207377安卓_base.apk
- 超微主板 X9DRE-TF+ bios 支持 nvme启动
- 基于Python通过下载气象数据和插值拟合离散数据曲线实现对寒潮过程的能量分析
- 智能车仿真软件.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功