hbase support

This commit is contained in:
温少
2012-05-19 15:04:46 +08:00
parent 35f1e3483c
commit 7c7ee9c63c
5 changed files with 53 additions and 12 deletions
@@ -13,12 +13,16 @@ public class HBaseDriverTest extends TestCase {
HBaseDriver driver = new HBaseDriver();
Connection conn = driver.connect("jdbc:druid-hbase:10.20.153.63", new Properties());
PreparedStatement stmt = conn.prepareStatement("SELECT * FROM test");
PreparedStatement stmt = conn.prepareStatement("SELECT id, name, gender, salary FROM test_user");
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
System.out.print(rs.getString("@ROW"));
System.out.print(rs.getInt("id"));
System.out.print(' ');
System.out.print(rs.getString("id"));
System.out.print(rs.getString("name"));
System.out.print(' ');
System.out.print(rs.getString("gender"));
System.out.print(' ');
System.out.print(rs.getBigDecimal("salary"));
System.out.println();
}
rs.close();