package com.OOD.covert;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.junit.Test;
import com.dao.db.JDBCUtils;
import com.enty.bean.tb_mianshi;
import com.enty.bean.tb_muser;
import com.enty.bean.tb_pact_employ;
import com.enty.bean.tb_pact_factory;
import com.enty.bean.tb_recruit_info;
import com.enty.bean.tb_rent_factory;
import com.enty.bean.tb_technology;
import com.enty.bean.userbean;
import com.google.gson.Gson;
import com.mysql.jdbc.Statement;
import com.view.bean.tb_view_echnology_pass;
import com.view.bean.tb_view_factory;
import com.view.bean.tb_view_paidan;
import com.view.bean.tb_view_tools;
import com.view.bean.tb_view_zuzhong;
public class SQLHelper{
private static final int QUERY_TIMEOUT = 100;
private Connection con = null;
private PreparedStatement ps = null;
private ResultSet rs = null;
/*--------QueryRunner 增,改,插------------*/
public String Getuserbean(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<userbean> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<userbean>(userbean.class));
for (userbean obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public String Getfactoryinfo(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_rent_factory> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_rent_factory>(tb_rent_factory.class));
for (tb_rent_factory obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
System.out.println(e.toString());
e.printStackTrace();
}
return temp ;
}
public String GetInfo(String sql) {
String temp="";
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_recruit_info> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_recruit_info>(tb_recruit_info.class));
for (tb_recruit_info recruit_info : lists) {
System.out.println(recruit_info.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public String Getemploy_pass(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_mianshi> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_mianshi>(tb_mianshi.class));
for (tb_mianshi obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public String Getqiangdan(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_view_echnology_pass> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_view_echnology_pass>(tb_view_echnology_pass.class));
for (tb_view_echnology_pass obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public String GetmuserInfo(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_muser> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_muser>(tb_muser.class));
for (tb_muser muser : lists) {
System.out.println(muser.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public String Getechinfo(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_technology> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_technology>(tb_technology.class));
for (tb_technology obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
System.out.println(e.toString());
e.printStackTrace();
}
return temp ;
}
public String GetechPaidan(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_view_paidan> lists=null;
lists = qRunner.query(con,sql, new BeanListHandler<tb_view_paidan>(tb_view_paidan.class));
for (tb_view_paidan obj : lists) {
System.out.println(obj.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
/**********QueryRunner 插入 **************/
public String insertfactoryPact(String sql) {
String temp=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
List<tb_pact_factory> lists=null;
lists = qRunner.insert(con,sql, new BeanListHandler<tb_pact_factory>(tb_pact_factory.class));
for (tb_pact_factory muser : lists) {
System.out.println(muser.toString());
}
Gson g=new Gson();
temp=g.toJson(lists);
System.out.println("输出转换的json数据temp"+temp);
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
/************** 插入模块结束 *****************/
// 获取应聘状态
public int GetSate_employ(String sql) {
int temp=255;
List<tb_pact_employ> lists=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
lists = qRunner.query(con,sql, new BeanListHandler<tb_pact_employ>(tb_pact_employ.class));
for (tb_pact_employ re : lists) {
temp=re.getPe_state();
}
System.out.println("输出转换的json数据temp"+temp);
con.close();
}
catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
public int GetMid(String sql) {
int temp=255;
List<tb_pact_employ> lists=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConnection();
lists = qRunner.query(con,sql, new BeanListHandler<tb_pact_employ>(tb_pact_employ.class));
for (tb_pact_employ re : lists) {temp=re.getPe_state();}
System.out.println("输出转换的json数据temp"+temp);
con.close();
}
catch (SQLException e) {
e.printStackTrace();
}
return temp ;
}
// 获取应聘状态
public String Get_employHistory(String sql) {
String temp="";
List<tb_pact_employ> lists=null;
QueryRunner qRunner=new QueryRunner();
try {
con=JDBCUtils.getConn
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1.项目采用AppcanIDE进行开发,结合HTML5+CSS+JS混合开发模式;2.同时实现母板和子页框架嵌套,MD5加密,天气接口,LIstview表单事件,图片预览,JSON对象和串的传递和解析;3.实现了Ajax刷新,轮播图片;4.GPRS定位,导航和路径规划;5.后台采用接口进行数据传输;后端接口采用javaee进行设计开发,以json数据格式进行接口交互。
资源推荐
资源详情
资源评论
收起资源包目录
基于O2O的汽车快修APP(后端源码) (119个子文件)
SQLHelper.class 13KB
tb_muser.class 8KB
get_orderMangerWait.class 5KB
tb_recruit_info.class 5KB
get_mywork.class 5KB
tb_rent_factory.class 5KB
tb_technology.class 4KB
tb_rent_tools.class 4KB
get_kind.class 4KB
add_rent_tools.class 4KB
get_orderComplete.class 4KB
add_dispatch_qiangdan.class 3KB
get_orderMagerInto.class 3KB
Uitls.class 3KB
get_login.class 3KB
get_yingping.class 3KB
tb_view_tools.class 3KB
add_rentfactory.class 3KB
tb_view_paidan.class 3KB
tb_pact_rent.class 3KB
tb_type.class 3KB
add_register.class 3KB
tb_view_echnology_pass.class 2KB
get_history_offer.class 2KB
tb_pact_employ.class 2KB
get_updateinfo.class 2KB
get_view_factory.class 2KB
get_factory_info.class 2KB
get_person_info.class 2KB
tb_mianshi.class 2KB
get_view_tools.class 2KB
tb_type1.class 2KB
get_view_techpass.class 2KB
get_technologyfabu.class 2KB
tb_view_zuzhong.class 2KB
return_datatime.class 2KB
get_myinfo.class 2KB
tb_view_factory.class 2KB
get_pact_employ.class 2KB
del_pactfactory.class 2KB
tb_pact_factory.class 2KB
regionbean.class 1KB
tb_dispatch_qiang.class 1KB
userbean.class 892B
className.class 868B
JDBCUtils.class 721B
.classpath 2KB
org.eclipse.wst.common.component 702B
org.eclipse.wst.jsdt.ui.superType.container 49B
mysql-connector-java-5.1.10-bin.jar 707KB
c3p0-0.9.1.2.jar 596KB
c3p0-0.9.1.2-jdk1.3.jar 595KB
c3p0-0.9.5.2-sources.jar 351KB
commons-lang-2.4.jar 256KB
junit-4.10.jar 247KB
gson-2.2.4-javadoc.jar 244KB
commons-codec-1.6.jar 227KB
ant-contrib-1.0b2.jar 190KB
gson-2.2.4.jar 186KB
gson-2.2.4-sources.jar 125KB
commons-dbutils-1.6.jar 76KB
slf4j-api-1.8.0-beta0.jar 43KB
SQLHelper.java 15KB
tb_muser.java 11KB
get_orderMangerWait.java 5KB
get_mywork.java 5KB
tb_recruit_info.java 5KB
tb_rent_tools.java 4KB
tb_rent_factory.java 4KB
tb_technology.java 4KB
tb_type.java 3KB
get_kind.java 3KB
add_rent_tools.java 3KB
get_orderComplete.java 3KB
Uitls.java 3KB
tb_pact_rent.java 3KB
add_dispatch_qiangdan.java 2KB
tb_type1.java 2KB
get_orderMagerInto.java 2KB
tb_view_paidan.java 2KB
get_login.java 2KB
tb_view_tools.java 2KB
get_yingping.java 2KB
add_rentfactory.java 2KB
tb_view_echnology_pass.java 2KB
tb_pact_factory.java 2KB
tb_pact_employ.java 2KB
add_register.java 2KB
get_history_offer.java 2KB
tb_dispatch_qiang.java 1KB
tb_mianshi.java 1KB
get_updateinfo.java 1KB
tb_view_zuzhong.java 1KB
get_view_techpass.java 1KB
tb_view_factory.java 1KB
regionbean.java 1KB
get_view_factory.java 1KB
get_factory_info.java 1KB
get_person_info.java 1KB
get_myinfo.java 1KB
共 119 条
- 1
- 2
资源评论
大圣猿
- 粉丝: 3
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功