jdbc利用集合传递参数
来源:互联网 发布:seo新手教程 编辑:程序博客网 时间:2024/05/18 06:28
public static List<Emp> queryColor() {
// TODO Auto-generated method stub
List<Emp> table =new ArrayList<Emp>();
Connection con=null;
Statement sta=null;
ResultSet re=null;
String sql="select * from emp";
try {
con=JdbcUtil.getConn();
sta=con.createStatement();
re=sta.executeQuery(sql);
while(re.next())
{
Emp emp=new Emp();
emp.setName(re.getString("name"));
emp.setId(re.getInt("id"));
table.add(emp);
System.out.println(emp);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
}
return table;
}
// TODO Auto-generated method stub
List<Emp> table =new ArrayList<Emp>();
Connection con=null;
Statement sta=null;
ResultSet re=null;
String sql="select * from emp";
try {
con=JdbcUtil.getConn();
sta=con.createStatement();
re=sta.executeQuery(sql);
while(re.next())
{
Emp emp=new Emp();
emp.setName(re.getString("name"));
emp.setId(re.getInt("id"));
table.add(emp);
System.out.println(emp);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
}
return table;
}
阅读全文
0 0
- jdbc利用集合传递参数
- springmvc 集合参数传递
- 利用指针传递参数
- 利用JS传递参数
- 集合类参数的传递
- angular js 传递集合参数
- 利用javascript接收参数传递
- 利用call传递静态参数
- js 利用url传递参数
- 利用onNewIntent方法传递参数
- 利用注解规范参数传递
- 利用表单传递参数实例
- asp页面传递参数方法集合
- JSP利用URL重写传递参数示例
- 利用js弹出窗口并传递参数
- jsp中利用href传递参数
- 如何利用eclipse传递args[]参数
- 利用js页面间传递参数
- h5测试点
- Xamarin.Forms——上传图片
- 解题报告:HDU_6185 Covering (轮廓线DP+高斯消元+矩阵快速幂)
- 数组中的逆序对(归并排序思路)
- HDU 1087 FatMouse and Cheese——DP
- jdbc利用集合传递参数
- bitset总结
- MySQL 聚簇索引和非聚簇索引
- 深入理解Java虚拟机(第二章):Java内存区域与内存溢出异常
- Java_基础—多线程之间的通信以及JDK1.5新特性互斥锁
- git基本命令
- 初识static静态
- 真正的软件测试实习一
- 从大到小输出二叉搜索树中键值不小于K的关键字