shiyichenhong
shiyichenhong
2012-09-15 09:35

实例中的静态数组,怎么转化从数据库中取数,谢谢

已采纳
@Bind(id="myDataGrid",attribute="mergedColumns")
private String[] mergedColumns = new String[] {"test1"};
这是个初始化状态
@DataModel
private GridArray[] myDataGrid = new GridArray[] {
    new GridArray("1", "1", "1"), 
    new GridArray("2", "1", "2"),
    new GridArray("2", "3", "3"), 
    new GridArray("2", "5", "4"),
    new GridArray("2", "5", "5")
};

@DataModel
private GridArray[] myDataGrid = new GridArray[] {
    从数据库中取数,是用for循环吗?
};
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • jinnianshilongnian jinnianshilongnian 9年前

    1、jdbc取ResultSet
    2、循环创建GridArray 添加到List
    3、List.toArray() 转换为数组

    点赞 评论 复制链接分享

相关推荐