<< Click to Display Table of Contents >> JDBC访问的API |
Class.forName("g5.dc.jdbc.GDriver");
设置 Driver 为 "g5.dc.jdbc.GDriver"
Connection conn = DriverManager.getConnection("jdbc:yonghong:z", "admin", "g5");
Driver 的链接 url 为固定的 "jdbc:yonghong:z",用户名为 "admin",密码为 "g5"。
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select CITY, sum(CONSUME) + 2 as tp from cloud.clqry group by CITY order by tp ");
创建 sql 数据集,并返回 results。
DataGrid grid = RSExecutor.create(rs);
根据 results 生成 DataGrid.
GridUtil.print(grid, 20);
打印 DataGrid。生成的 DataGrid 为可进行二次开发的数据集。