mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
hbase support
This commit is contained in:
@@ -15,7 +15,7 @@ public class HBaseDriver implements Driver {
|
||||
return null;
|
||||
}
|
||||
|
||||
String rest = url.substring(PREFIX.length() + 1);
|
||||
String rest = url.substring(PREFIX.length());
|
||||
|
||||
info.put("hbase.zookeeper.quorum", rest);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.sql.Statement;
|
||||
|
||||
import org.apache.hadoop.hbase.client.Result;
|
||||
import org.apache.hadoop.hbase.client.ResultScanner;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
|
||||
import com.alibaba.druid.common.jdbc.ResultSetBase;
|
||||
|
||||
@@ -59,6 +60,14 @@ public class HBaseResultSet extends ResultSetBase {
|
||||
public Object getObjectInternal(int columnIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString(String columnName) throws SQLException {
|
||||
byte[] qualifier = Bytes.toBytes(columnName);
|
||||
byte[] family = Bytes.toBytes("d");
|
||||
byte[] value = result.getValue(family, qualifier);
|
||||
return Bytes.toString(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws SQLException {
|
||||
|
||||
Reference in New Issue
Block a user