mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
hbase support
This commit is contained in:
@@ -9,5 +9,5 @@ public interface ExecutePlan {
|
||||
|
||||
HBaseResultSet executeQuery(HBasePreparedStatement statement) throws SQLException;
|
||||
|
||||
void execute(HBasePreparedStatement statement);
|
||||
void execute(HBasePreparedStatement statement) throws SQLException;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ExecutePlanAdapter implements ExecutePlan {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(HBasePreparedStatement statement) {
|
||||
public void execute(HBasePreparedStatement statement) throws SQLException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
package com.alibaba.druid.hbase.exec;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.hadoop.hbase.client.HTableInterface;
|
||||
|
||||
import com.alibaba.druid.hbase.HBaseConnection;
|
||||
import com.alibaba.druid.hbase.HBasePreparedStatement;
|
||||
|
||||
|
||||
|
||||
public class InsertExecutePlan extends SingleTableExecutePlan {
|
||||
|
||||
@Override
|
||||
public void execute(HBasePreparedStatement statement) {
|
||||
throw new UnsupportedOperationException();
|
||||
public void execute(HBasePreparedStatement statement) throws SQLException {
|
||||
try {
|
||||
HBaseConnection connection = statement.getConnection();
|
||||
HTableInterface htable = connection.getHTable(getTableName());
|
||||
|
||||
throw new UnsupportedOperationException();
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new SQLException("executeQuery error", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user