API Accessed by JDBC

<< Click to Display Table of Contents >>

Current:  Data Mart > MPP > Secondary Development 

API Accessed by JDBC

Previous pageReturn to chapter overviewNext page

Class.forName("g5.dc.jdbc.GDriver");

Set Driver as "g5.dc.jdbc.GDriver"

Connection conn = DriverManager.getConnection("jdbc:yonghong:z", "admin", "g5");

The url of Driver is the fixed "jdbc:yonghong:z", which username is "admin", and password is "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 ");

Create the sql data set and return results. 

DataGrid grid = RSExecutor.create(rs);

Generate DataGrid according to results.

GridUtil.print(grid, 20);

Print DataGrid. The generated DataGrid is the data set that can undertake secondary development.