From 7a8e973e51b8e37a78542f41a42f5eed16b3bf48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A9=E5=B0=91?= Date: Mon, 21 May 2012 16:35:12 +0800 Subject: [PATCH] refactor --- src/main/java/com/alibaba/druid/hdriver/HConnection.java | 2 ++ .../alibaba/druid/hdriver/impl/HBaseConnectionImpl.java | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/alibaba/druid/hdriver/HConnection.java b/src/main/java/com/alibaba/druid/hdriver/HConnection.java index 605fbf014d..be141ec570 100644 --- a/src/main/java/com/alibaba/druid/hdriver/HConnection.java +++ b/src/main/java/com/alibaba/druid/hdriver/HConnection.java @@ -7,4 +7,6 @@ import com.alibaba.druid.hdriver.impl.HPreparedStatementImpl; public interface HConnection extends Connection { HPreparedStatementImpl prepareStatement(String sql) throws SQLException; + + HStatement createStatement() throws SQLException;; } diff --git a/src/main/java/com/alibaba/druid/hdriver/impl/HBaseConnectionImpl.java b/src/main/java/com/alibaba/druid/hdriver/impl/HBaseConnectionImpl.java index 7276f7cd62..3798602b23 100644 --- a/src/main/java/com/alibaba/druid/hdriver/impl/HBaseConnectionImpl.java +++ b/src/main/java/com/alibaba/druid/hdriver/impl/HBaseConnectionImpl.java @@ -13,7 +13,6 @@ import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLXML; import java.sql.Savepoint; -import java.sql.Statement; import java.sql.Struct; import java.util.Map; import java.util.Properties; @@ -22,6 +21,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.HTableInterface; import com.alibaba.druid.hdriver.HConnection; +import com.alibaba.druid.hdriver.HStatement; import com.alibaba.druid.util.jdbc.ConnectionBase; public class HBaseConnectionImpl extends ConnectionBase implements HConnection { @@ -76,17 +76,17 @@ public class HBaseConnectionImpl extends ConnectionBase implements HConnection { } @Override - public Statement createStatement() throws SQLException { + public HStatement createStatement() throws SQLException { return new HStatementImpl(this); } @Override - public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { + public HStatement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { throw new SQLFeatureNotSupportedException(); } @Override - public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) + public HStatement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { throw new SQLFeatureNotSupportedException(); }