epay-8 多表查询,一维数组怎么放入二维数组??
来源:互联网 发布:怎么修改mysql端口号 编辑:程序博客网 时间:2024/05/21 20:30
// 查询子项目
public String[][] getChildItems() {
String childItems[][] = {};
String result = "", sql;
PreparedStatement pstmt;
ResultSet rest;
// 连接数据库
DBUtil db = new DBUtil();
Connection con = db.getConnectionInformix();
if (con != null) {
sql = "select ec_module.name from ec_pcmodule,ec_module where ec_pcmodule.module>7000 and ec_pcmodule.module<7500 and ec_pcmodule.module=ec_module.code";
try {
pstmt = con.prepareStatement(sql);
// pstmt.setInt(1, elem);
rest = pstmt.executeQuery();
ArrayList<String> list = new ArrayList<String>();
while (rest.next()) {
// 加入线性表
list.add(StringUtils.getChinese(rest.getString(1)));
// result += ","
// + StringUtils.getChinese(rest.getString(1));
}
// 线性表转成数组
String str[] = list.toArray(new String[0]);
System.out.println("数组===>"+Arrays.toString(str));
// 一维数组如何放入二维数组??
System.out.println("二维数组==>"+Arrays.toString(childItems));
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return childItems;
}
public String[][] getChildItems() {
String childItems[][] = {};
String result = "", sql;
PreparedStatement pstmt;
ResultSet rest;
// 连接数据库
DBUtil db = new DBUtil();
Connection con = db.getConnectionInformix();
if (con != null) {
sql = "select ec_module.name from ec_pcmodule,ec_module where ec_pcmodule.module>7000 and ec_pcmodule.module<7500 and ec_pcmodule.module=ec_module.code";
try {
pstmt = con.prepareStatement(sql);
// pstmt.setInt(1, elem);
rest = pstmt.executeQuery();
ArrayList<String> list = new ArrayList<String>();
while (rest.next()) {
// 加入线性表
list.add(StringUtils.getChinese(rest.getString(1)));
// result += ","
// + StringUtils.getChinese(rest.getString(1));
}
// 线性表转成数组
String str[] = list.toArray(new String[0]);
System.out.println("数组===>"+Arrays.toString(str));
// 一维数组如何放入二维数组??
System.out.println("二维数组==>"+Arrays.toString(childItems));
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return childItems;
}
- epay-8 多表查询,一维数组怎么放入二维数组??
- 一维数组、二维数组
- Java数组 一维数组,二维数组
- array 数组 一维数组 二维数组
- Javascript - 数组 一维数组 二维数组
- 将excel数据放入二维数组
- C#数组 一维数组、二维数组、三维数组
- 一维数组,二维数组,三维数组,多维数组整理
- java中两个一维数组怎么能合成一个二维数组!!!请大哥门指点!!!
- 二维数组转变成一维数组
- 一维数组转二维数组,旋转
- C动态一维数组,二维数组
- 一维数组转二维数组
- 关于一维数组和二维数组
- python 一维数组变为二维数组
- 数据结构 二维数组表示一维数组
- PHP 一维数组转二维数组
- 一维数组转二维数组,旋转
- TextView属性
- 景深效果
- hdu 1558 Segment set(并查集+计算几何线段相交)
- 在Eclipse中查看JDK类库的源代码
- Python笔记(3)异常处理
- epay-8 多表查询,一维数组怎么放入二维数组??
- hive 全排序 优化
- 由pushViewController说起可能出线的各种死法
- Android Keycode详解
- Java:抽象类和接口
- 实现顺序查找的算法
- UIScrollView 原理详解
- C# Post数据流到HTTP地址
- VC6.0和VS2005编译器的区别