mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -9,6 +9,7 @@ import org.apache.hadoop.hbase.HTableDescriptor;
|
||||
import org.apache.hadoop.hbase.client.HBaseAdmin;
|
||||
|
||||
import com.alibaba.druid.hdriver.HResultSet;
|
||||
import com.alibaba.druid.hdriver.HStatement;
|
||||
import com.alibaba.druid.hdriver.impl.jdbc.HPreparedStatementImpl;
|
||||
import com.alibaba.druid.hdriver.impl.jdbc.HResultSetMetaData;
|
||||
import com.alibaba.druid.util.jdbc.ResultSetBase;
|
||||
@@ -169,5 +170,10 @@ public class ShowTablesPlan implements ExecutePlan {
|
||||
@Override
|
||||
public void updateObject(int columnIndex, Object x) throws SQLException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public HStatement getStatement() throws SQLException {
|
||||
return (HStatement) statement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.alibaba.druid.hdriver.impl.jdbc;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.hdriver.HPreparedStatement;
|
||||
import com.alibaba.druid.hdriver.HResultSet;
|
||||
import com.alibaba.druid.hdriver.impl.execute.ExecutePlan;
|
||||
import com.alibaba.druid.hdriver.impl.execute.InsertExecutePlan;
|
||||
import com.alibaba.druid.hdriver.impl.execute.ShowTablesPlan;
|
||||
@@ -29,14 +29,14 @@ import com.alibaba.druid.util.jdbc.ResultSetMetaDataBase.ColumnMetaData;
|
||||
|
||||
public class HPreparedStatementImpl extends PreparedStatementBase implements HPreparedStatement {
|
||||
|
||||
private final String sql;
|
||||
private String[] columnNames;
|
||||
private final String sql;
|
||||
private String[] columnNames;
|
||||
|
||||
private HBaseConnectionImpl hbaseConnection;
|
||||
|
||||
private ExecutePlan executePlan;
|
||||
private ExecutePlan executePlan;
|
||||
|
||||
private String dbType = "hbase";
|
||||
private String dbType = "hbase";
|
||||
|
||||
public HPreparedStatementImpl(HBaseConnectionImpl conn, String sql) throws SQLException{
|
||||
super(conn);
|
||||
@@ -145,7 +145,7 @@ public class HPreparedStatementImpl extends PreparedStatementBase implements HPr
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet executeQuery() throws SQLException {
|
||||
public HResultSet executeQuery() throws SQLException {
|
||||
return this.executePlan.executeQuery(this);
|
||||
}
|
||||
|
||||
@@ -162,4 +162,7 @@ public class HPreparedStatementImpl extends PreparedStatementBase implements HPr
|
||||
return false;
|
||||
}
|
||||
|
||||
public HResultSet getResultSet() throws SQLException {
|
||||
return (HResultSet) super.getResultSet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.alibaba.druid.hdriver.impl.jdbc;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Types;
|
||||
|
||||
import org.apache.hadoop.hbase.client.HTableInterface;
|
||||
@@ -44,7 +43,7 @@ public class HScannerResultSet extends ResultSetBase implements HResultSet {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Statement getStatement() throws SQLException {
|
||||
public HStatement getStatement() throws SQLException {
|
||||
return statement;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.alibaba.druid.hdriver.impl.jdbc;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import com.alibaba.druid.hdriver.HResultSet;
|
||||
import com.alibaba.druid.hdriver.HStatement;
|
||||
import com.alibaba.druid.util.jdbc.StatementBase;
|
||||
|
||||
@@ -23,4 +24,8 @@ public class HStatementImpl extends StatementBase implements Statement, HStateme
|
||||
public void checkOpen() {
|
||||
|
||||
}
|
||||
|
||||
public HResultSet getResultSet() throws SQLException {
|
||||
return (HResultSet) super.getResultSet();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user