incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [21/51] [partial] Initial repackage to org.apache.
Date Mon, 03 Sep 2012 03:17:12 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/parser/Parser.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/parser/Parser.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/parser/Parser.java
deleted file mode 100644
index 1e1267b..0000000
--- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/parser/Parser.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package com.nearinfinity.blur.jdbc.parser;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class Parser {
-
-  private static final String SELECT = "select";
-  private static final String WHERE = "where";
-  private static final String NATURAL = "natural";
-  private static final String FROM = "from";
-  private static final String JOIN = "join";
-  private static final String SEP = new String(new char[] { 1 });
-
-  public static void main(String[] args) {
-    // System.out.println(new
-    // Parser().parse("select * from table where query('person.pn:(nice cool)')"));
-    // System.out.println(new
-    // Parser().parse("select * from table natural join table2 where person.pn = 'coandol''s' and jon='asdndandanda' And person.pf ='niorce' or nice = 'be'"));
-    // System.out.println(new
-    // Parser().parse("select * from table where person.pn = 'coandol''s' and jon='asdndandanda' And person.pf ='niorce' or nice = 'be'"));
-    System.out.println(new Parser().parse("SELECT * FROM TEST_TABLE T WHERE 1 = 0"));
-    System.out.println(new Parser().parse("select * from table t where 1 = 0"));
-    // System.out.println(new
-    // Parser().parse("select id,locationid,score,cf1.* from table where query('+person.pn:(nice cool) AND cool.a:nice')"));
-  }
-
-  private String where;
-  private String tableName;
-  private List<String> columnNames;
-  private String joinTable;
-
-  public Parser parse(String query) {
-    columnNames = getColumnNames(query);
-    tableName = getTableName(query);
-    where = getWhere(query);
-    joinTable = getJoin(query);
-    return this;
-  }
-
-  public String getJoinTable() {
-    return joinTable;
-  }
-
-  private String getJoin(String query) {
-    String table = null;
-    StringTokenizer tokenizer = new StringTokenizer(query);
-    while (tokenizer.hasMoreTokens()) {
-      if (NATURAL.equals(tokenizer.nextToken().toLowerCase())) {
-        if (JOIN.equals(tokenizer.nextToken().toLowerCase())) {
-          table = tokenizer.nextToken();
-        } else {
-          throw new RuntimeException();
-        }
-      }
-    }
-    return table;
-  }
-
-  private String getWhere(String query) {
-    StringBuilder result = new StringBuilder();
-    StringTokenizer tokenizer = new StringTokenizer(query);
-    while (tokenizer.hasMoreTokens()) {
-      if (WHERE.equals(tokenizer.nextToken().toLowerCase())) {
-        while (tokenizer.hasMoreTokens()) {
-          String token = tokenizer.nextToken();
-          result.append(token).append(' ');
-        }
-      }
-    }
-    return getQuery(result.toString().trim());
-  }
-
-  private String getQuery(String query) {
-    Pattern p = Pattern.compile("([qQ][uU][eE][rR][yY]\\s*\\(\\s*')(.*)('\\s*\\).*)");
-    Matcher matcher = p.matcher(query);
-    if (matcher.find()) {
-      if (matcher.groupCount() != 3) {// first one is the whole string
-        throw new RuntimeException("malformed query [" + query + "]");
-      }
-      return matcher.group(2);// 2nd group is the lucene query
-    } else {
-      return changeQueryToLucene(query);
-    }
-  }
-
-  private String changeQueryToLucene(String query) {
-    query = fixAndsOrs(query);
-    query = query.replaceAll("\\s*=\\s*", ":");
-    query = query.replace("''", SEP);
-    query = query.replaceAll("'", "");
-    query = query.replace(SEP, "'");
-    return query;
-  }
-
-  private String fixAndsOrs(String query) {
-    query = fixToUpperToken(query, "AND");
-    query = fixToUpperToken(query, "OR");
-    return query;
-  }
-
-  private String fixToUpperToken(String query, String token) {
-    String queryUpper = query.toUpperCase();
-    int start = 0;
-    int index = queryUpper.indexOf(token, start);
-    while (index != -1) {
-      if (!query.substring(index, index + token.length()).equals(token)) {
-        String everythingInStringToCurrentPosition = query.substring(0, index);
-        if (!isHitInParameter(everythingInStringToCurrentPosition)) {
-          query = query.substring(0, index) + token + query.substring(index + token.length());
-          return fixToUpperToken(query, token);
-        }
-      }
-      start = index + 1;
-      index = queryUpper.indexOf(token, start);
-    }
-    return query;
-  }
-
-  private boolean isHitInParameter(String everythingInStringToCurrentPosition) {
-    char[] charArray = everythingInStringToCurrentPosition.toCharArray();
-    int count = 0;
-    for (int i = 0; i < charArray.length; i++) {
-      if (charArray[i] == '\'') {
-        count++;
-      }
-    }
-    return count % 2 != 0;
-  }
-
-  private String getTableName(String query) {
-    StringTokenizer tokenizer = new StringTokenizer(query);
-    while (tokenizer.hasMoreTokens()) {
-      if (FROM.equals(tokenizer.nextToken().toLowerCase())) {
-        if (tokenizer.hasMoreTokens()) {
-          return tokenizer.nextToken();
-        }
-      }
-    }
-    throw new IllegalArgumentException("Table not found");
-  }
-
-  private List<String> getColumnNames(String query) {
-    StringTokenizer tokenizer = new StringTokenizer(query);
-    List<String> columnNames = new ArrayList<String>();
-    while (tokenizer.hasMoreTokens()) {
-      if (SELECT.equals(tokenizer.nextToken().toLowerCase())) {
-        while (tokenizer.hasMoreTokens()) {
-          String token = tokenizer.nextToken().toLowerCase();
-          if (FROM.equals(token)) {
-            return columnNames;
-          }
-          processColumnToken(columnNames, token);
-        }
-      }
-    }
-    return null;
-  }
-
-  private void processColumnToken(List<String> columnNames, String token) {
-    StringTokenizer tokenizer = new StringTokenizer(token, ",");
-    while (tokenizer.hasMoreTokens()) {
-      columnNames.add(tokenizer.nextToken());
-    }
-  }
-
-  public String getTableName() {
-    return tableName;
-  }
-
-  public List<String> getColumnNames() {
-    return columnNames;
-  }
-
-  public String getWhere() {
-    if (where == null || where.trim().isEmpty()) {
-      return "*";
-    }
-    return where;
-  }
-
-  @Override
-  public String toString() {
-    return "Parser [columnNames=" + columnNames + ", tableName=" + tableName + ", where=" + where + ", joinTable=" + joinTable + "]";
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSet.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSet.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSet.java
deleted file mode 100644
index bcd7495..0000000
--- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSet.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.nearinfinity.blur.jdbc.util;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-
-import com.nearinfinity.blur.jdbc.abstractimpl.AbstractBlurResultSet;
-
-public class EmptyResultSet extends AbstractBlurResultSet {
-
-  @Override
-  public void close() throws SQLException {
-
-  }
-
-  @Override
-  public boolean next() throws SQLException {
-    return false;
-  }
-
-  @Override
-  public ResultSetMetaData getMetaData() throws SQLException {
-    return new EmptyResultSetMetaData();
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSetMetaData.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSetMetaData.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSetMetaData.java
deleted file mode 100644
index d62b83c..0000000
--- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/EmptyResultSetMetaData.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.nearinfinity.blur.jdbc.util;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-
-import com.nearinfinity.blur.jdbc.abstractimpl.AbstractBlurResultSetMetaData;
-
-public class EmptyResultSetMetaData extends AbstractBlurResultSetMetaData implements ResultSetMetaData {
-
-  @Override
-  public int getColumnCount() throws SQLException {
-    return 0;
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/NotImplemented.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/NotImplemented.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/NotImplemented.java
deleted file mode 100644
index e8ccc37..0000000
--- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/NotImplemented.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.nearinfinity.blur.jdbc.util;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-public class NotImplemented extends RuntimeException {
-
-  public static final String BLUR_JDBC_DEBUG = "blur.jdbc.debug";
-  private static final long serialVersionUID = 4736975316647139778L;
-  public static final boolean debug = Boolean.getBoolean(BLUR_JDBC_DEBUG);
-
-  public NotImplemented() {
-    this(null);
-  }
-
-  public NotImplemented(String name) {
-    if (debug) {
-      if (name != null) {
-        System.err.println("Method [" + name + "]");
-      }
-      new Throwable().printStackTrace();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/SimpleStringResultSet.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/SimpleStringResultSet.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/SimpleStringResultSet.java
deleted file mode 100644
index 3e939bf..0000000
--- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/util/SimpleStringResultSet.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.nearinfinity.blur.jdbc.util;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.List;
-import java.util.Map;
-
-import com.nearinfinity.blur.jdbc.abstractimpl.AbstractBlurResultSet;
-import com.nearinfinity.blur.jdbc.abstractimpl.AbstractBlurResultSetMetaData;
-
-public class SimpleStringResultSet extends AbstractBlurResultSet {
-
-  private List<String> columnNames;
-  private List<Map<String, String>> data;
-  private int position = -1;
-  private String lastValue;
-
-  public SimpleStringResultSet(List<String> columnNames, List<Map<String, String>> data) {
-    this.columnNames = columnNames;
-    this.data = data;
-  }
-
-  @Override
-  public ResultSetMetaData getMetaData() throws SQLException {
-    return new SimpleStringResultSetMetaData(columnNames);
-  }
-
-  @Override
-  public boolean next() throws SQLException {
-    if (position + 1 >= data.size()) {
-      return false;
-    }
-    position++;
-    return true;
-  }
-
-  @Override
-  public String getString(int columnIndex) throws SQLException {
-    String name = columnNames.get(columnIndex - 1);
-    Map<String, String> row = data.get(position);
-    return lastValue = row.get(name);
-  }
-
-  @Override
-  public boolean wasNull() throws SQLException {
-    return lastValue == null ? true : false;
-  }
-
-  @Override
-  public void close() throws SQLException {
-
-  }
-
-  public static class SimpleStringResultSetMetaData extends AbstractBlurResultSetMetaData {
-
-    private List<String> columnNames;
-
-    public SimpleStringResultSetMetaData(List<String> columnNames) {
-      this.columnNames = columnNames;
-    }
-
-    @Override
-    public int getColumnCount() throws SQLException {
-      return columnNames.size();
-    }
-
-    @Override
-    public String getColumnName(int column) throws SQLException {
-      return columnNames.get(column - 1);
-    }
-
-    @Override
-    public int getColumnType(int column) throws SQLException {
-      return Types.VARCHAR;
-    }
-
-    @Override
-    public String getColumnTypeName(int column) throws SQLException {
-      return "string";
-    }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurConnection.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurConnection.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurConnection.java
new file mode 100644
index 0000000..2ba3500
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurConnection.java
@@ -0,0 +1,118 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Statement;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurConnection;
+
+
+public class BlurConnection extends AbstractBlurConnection {
+
+  private boolean closed;
+  private int port;
+  private String host;
+  private String catalog;
+  private String url;
+  private String username;
+
+  public BlurConnection(String url, String username, String host, int port, String catalog) {
+    this.host = host;
+    this.port = port;
+    this.catalog = catalog;
+    this.url = url;
+    this.username = username;
+  }
+
+  @Override
+  public void close() throws SQLException {
+
+  }
+
+  @Override
+  public String getCatalog() throws SQLException {
+    return catalog;
+  }
+
+  @Override
+  public DatabaseMetaData getMetaData() throws SQLException {
+    return new BlurDatabaseMetaData(url, username, host, port);
+  }
+
+  @Override
+  public Statement createStatement() throws SQLException {
+    return new BlurStatement(this);
+  }
+
+  @Override
+  public PreparedStatement prepareStatement(String sql) throws SQLException {
+    return new BlurPreparedStatement(this, sql);
+  }
+
+  @Override
+  public boolean getAutoCommit() throws SQLException {
+    return false;
+  }
+
+  @Override
+  public SQLWarning getWarnings() throws SQLException {
+    return new BlurWarnings();
+  }
+
+  @Override
+  public boolean isClosed() throws SQLException {
+    return closed;
+  }
+
+  @Override
+  public boolean isReadOnly() throws SQLException {
+    return true;
+  }
+
+  @Override
+  public void setAutoCommit(boolean arg0) throws SQLException {
+
+  }
+
+  @Override
+  public void clearWarnings() throws SQLException {
+
+  }
+
+  @Override
+  public void rollback() throws SQLException {
+
+  }
+
+  public int getPort() {
+    return port;
+  }
+
+  public String getHost() {
+    return host;
+  }
+
+  @Override
+  public int getTransactionIsolation() throws SQLException {
+    return TRANSACTION_NONE;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurDatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurDatabaseMetaData.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurDatabaseMetaData.java
new file mode 100644
index 0000000..502d7b0
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurDatabaseMetaData.java
@@ -0,0 +1,424 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.RowIdLifetime;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurDatabaseMetaData;
+import org.apache.blur.jdbc.util.EmptyResultSet;
+import org.apache.blur.jdbc.util.SimpleStringResultSet;
+import org.apache.blur.thrift.BlurClientManager;
+import org.apache.blur.thrift.commands.BlurCommand;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.Schema;
+import org.apache.blur.thrift.generated.TableDescriptor;
+import org.apache.blur.thrift.generated.Blur.Client;
+import org.apache.thrift.TException;
+
+
+public class BlurDatabaseMetaData extends AbstractBlurDatabaseMetaData {
+
+  private static final String REF_GENERATION = "REF_GENERATION";
+  private static final String SELF_REFERENCING_COL_NAME = "SELF_REFERENCING_COL_NAME";
+  private static final String TYPE_NAME = "TYPE_NAME";
+  private static final String TYPE_SCHEM = "TYPE_SCHEM";
+  private static final String TYPE_CAT = "TYPE_CAT";
+  private static final String REMARKS = "REMARKS";
+  private static final String TABLE_TYPE = "TABLE_TYPE";
+  private static final String TABLE_NAME = "TABLE_NAME";
+  private static final String TABLE_SCHEM = "TABLE_SCHEM";
+  private static final String TABLE_CAT = "TABLE_CAT";
+  private static final String TABLE_CATALOG = "TABLE_CATALOG";
+
+  private int minorVersion = 1;
+  private int majorVersion = 1;
+  private String url;
+  private String username;
+  private int port;
+  private String host;
+  private List<String> tables;
+  private Map<String, Schema> schemaMap = new TreeMap<String, Schema>();
+
+  public BlurDatabaseMetaData(String url, String username, String host, int port) {
+    this.url = url;
+    this.username = username;
+    this.host = host;
+    this.port = port;
+    try {
+      BlurClientManager.execute(this.host + ":" + this.port, new BlurCommand<Void>() {
+
+        @Override
+        public Void call(Client client) throws BlurException, TException {
+          tables = client.tableList();
+          for (String table : tables) {
+            TableDescriptor descriptor = client.describe(table);
+            if (descriptor.isEnabled) {
+              schemaMap.put(table, client.schema(table));
+            }
+          }
+          return null;
+        }
+      });
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  @Override
+  public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException {
+    return super.getBestRowIdentifier(catalog, schema, table, scope, nullable);
+  }
+
+  @Override
+  public ResultSet getSchemas() throws SQLException {
+    List<Map<String, String>> data = new ArrayList<Map<String, String>>();
+    for (String table : tables) {
+      Map<String, String> row = new HashMap<String, String>();
+      row.put(TABLE_SCHEM, table);
+      data.add(row);
+    }
+    return new SimpleStringResultSet(Arrays.asList(TABLE_SCHEM, TABLE_CATALOG), data);
+  }
+
+  @Override
+  public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
+    List<Map<String, String>> data = new ArrayList<Map<String, String>>();
+    for (String table : tables) {
+      if (tableNamePattern != null && !table.equals(tableNamePattern)) {
+        continue;
+      }
+      Schema schema = schemaMap.get(table);
+      Map<String, Set<String>> columnFamilies = schema.columnFamilies;
+      addTableRow(data, table, table);
+      for (String columnFamily : columnFamilies.keySet()) {
+        String tablePlusCf = table + "." + columnFamily;
+        if (tableNamePattern != null && !tablePlusCf.equals(tableNamePattern)) {
+          continue;
+        }
+        addTableRow(data, table, tablePlusCf);
+      }
+    }
+    return new TableDescriptorResultSet(data);
+  }
+
+  @Override
+  public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  private void addTableRow(List<Map<String, String>> data, String schem, String table) {
+    Map<String, String> row = new HashMap<String, String>();
+    row.put(TABLE_SCHEM, schem);
+    row.put(TABLE_NAME, table);
+    row.put(TABLE_TYPE, "TABLE");
+    row.put(REMARKS, "");
+    data.add(row);
+  }
+
+  public static class TableDescriptorResultSet extends SimpleStringResultSet {
+    private static final List<String> COL_NAMES = Arrays.asList(TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        SELF_REFERENCING_COL_NAME, REF_GENERATION);
+
+    public TableDescriptorResultSet(List<Map<String, String>> data) {
+      super(COL_NAMES, data);
+    }
+  }
+
+  @Override
+  public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public String getSQLKeywords() throws SQLException {
+    return "";
+  }
+
+  public int getDefaultTransactionIsolation() throws SQLException {
+    return Connection.TRANSACTION_NONE;
+  }
+
+  public ResultSet getTableTypes() throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  public String getDatabaseProductName() throws SQLException {
+    return "blur";
+  }
+
+  public String getCatalogSeparator() throws SQLException {
+    return ",";
+  }
+
+  public String getDriverName() throws SQLException {
+    return "blur";
+  }
+
+  public String getDriverVersion() throws SQLException {
+    return "0.1";
+  }
+
+  public String getIdentifierQuoteString() throws SQLException {
+    return "'";
+  }
+
+  @Override
+  public String getDatabaseProductVersion() throws SQLException {
+    return "0.1";
+  }
+
+  @Override
+  public ResultSet getCatalogs() throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public ResultSet getClientInfoProperties() throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public RowIdLifetime getRowIdLifetime() throws SQLException {
+    return RowIdLifetime.ROWID_UNSUPPORTED;
+  }
+
+  @Override
+  public int getSQLStateType() throws SQLException {
+    return sqlStateSQL;
+  }
+
+  @Override
+  public int getJDBCMajorVersion() throws SQLException {
+    return majorVersion;
+  }
+
+  @Override
+  public int getJDBCMinorVersion() throws SQLException {
+    return minorVersion;
+  }
+
+  @Override
+  public int getDatabaseMajorVersion() throws SQLException {
+    return majorVersion;
+  }
+
+  @Override
+  public int getDatabaseMinorVersion() throws SQLException {
+    return minorVersion;
+  }
+
+  @Override
+  public int getResultSetHoldability() throws SQLException {
+    return ResultSet.CLOSE_CURSORS_AT_COMMIT;
+  }
+
+  @Override
+  public int getMaxTablesInSelect() throws SQLException {
+    return 1;
+  }
+
+  @Override
+  public int getMaxUserNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public String getTimeDateFunctions() throws SQLException {
+    return "";
+  }
+
+  @Override
+  public int getMaxStatementLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxStatements() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxTableNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxRowSize() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public String getStringFunctions() throws SQLException {
+    return "";
+  }
+
+  @Override
+  public int getMaxCatalogNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxProcedureNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxSchemaNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public String getCatalogTerm() throws SQLException {
+    return "catalog";
+  }
+
+  @Override
+  public int getDriverMajorVersion() {
+    return majorVersion;
+  }
+
+  @Override
+  public int getDriverMinorVersion() {
+    return minorVersion;
+  }
+
+  @Override
+  public String getExtraNameCharacters() throws SQLException {
+    return ".";
+  }
+
+  @Override
+  public int getMaxBinaryLiteralLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxCharLiteralLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxColumnNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxColumnsInGroupBy() throws SQLException {
+    return 0;
+  }
+
+  @Override
+  public int getMaxColumnsInIndex() throws SQLException {
+    return 0;
+  }
+
+  @Override
+  public int getMaxColumnsInOrderBy() throws SQLException {
+    return 0;
+  }
+
+  @Override
+  public int getMaxColumnsInSelect() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxColumnsInTable() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxConnections() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxCursorNameLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public int getMaxIndexLength() throws SQLException {
+    return Integer.MAX_VALUE;
+  }
+
+  @Override
+  public String getNumericFunctions() throws SQLException {
+    return "";
+  }
+
+  @Override
+  public String getProcedureTerm() throws SQLException {
+    return "procedure";
+  }
+
+  @Override
+  public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public String getSchemaTerm() throws SQLException {
+    return "schema";
+  }
+
+  @Override
+  public String getSearchStringEscape() throws SQLException {
+    return "\\";
+  }
+
+  @Override
+  public ResultSet getTypeInfo() throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public String getURL() throws SQLException {
+    return url;
+  }
+
+  @Override
+  public String getUserName() throws SQLException {
+    return username;
+  }
+
+  @Override
+  public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException {
+    return new EmptyResultSet();
+  }
+
+  @Override
+  public String getSystemFunctions() throws SQLException {
+    return "";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurJdbc.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurJdbc.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurJdbc.java
new file mode 100644
index 0000000..bb099c0
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurJdbc.java
@@ -0,0 +1,88 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public class BlurJdbc implements Driver {
+
+  static {
+    try {
+      java.sql.DriverManager.registerDriver(new BlurJdbc());
+    } catch (SQLException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  @Override
+  public boolean acceptsURL(String url) throws SQLException {
+    // jdbc:blur:host:port
+    String[] split = url.split(":");
+    if (split.length != 4) {
+      return false;
+    }
+    if ("jdbc".equals(split[0])) {
+      if ("blur".equals(split[1])) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @Override
+  public Connection connect(String url, Properties info) throws SQLException {
+    // jdbc:blur:host:port
+    String username = "";
+    String[] split = url.split(":");
+    if (split.length != 4) {
+      throw new SQLException("Invalid url [" + url + "]");
+    }
+    if ("jdbc".equals(split[0])) {
+      if ("blur".equals(split[1])) {
+        String host = split[2];
+        int port = Integer.parseInt(split[3]);
+        return new BlurConnection(url, username, host, port, host);
+      }
+    }
+    throw new SQLException("Invalid url [" + url + "]");
+  }
+
+  @Override
+  public int getMajorVersion() {
+    return 1;
+  }
+
+  @Override
+  public int getMinorVersion() {
+    return 0;
+  }
+
+  @Override
+  public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
+    return null;
+  }
+
+  @Override
+  public boolean jdbcCompliant() {
+    return false;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurPreparedStatement.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurPreparedStatement.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurPreparedStatement.java
new file mode 100644
index 0000000..1e796db
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurPreparedStatement.java
@@ -0,0 +1,45 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurPreparedStatement;
+
+
+public class BlurPreparedStatement extends AbstractBlurPreparedStatement {
+
+  private BlurStatement blurStatement;
+  private String sql;
+
+  public BlurPreparedStatement(BlurConnection connection, String sql) {
+    this.sql = sql;
+    blurStatement = new BlurStatement(connection);
+  }
+
+  @Override
+  public boolean execute() throws SQLException {
+    return blurStatement.execute(sql);
+  }
+
+  @Override
+  public ResultSet getResultSet() throws SQLException {
+    return blurStatement.getResultSet();
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetMetaData.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetMetaData.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetMetaData.java
new file mode 100644
index 0000000..f1b9c8d
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetMetaData.java
@@ -0,0 +1,228 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurResultSetMetaData;
+
+
+public class BlurResultSetMetaData extends AbstractBlurResultSetMetaData {
+
+  public static final String RECORDID = "recordid";
+  public static final String FAMILY = "family";
+  public static final String LOCATIONID = "locationid";
+  public static final String SCORE = "score";
+  public static final String ROWID = "rowid";
+
+  public enum QUERY_COLUMN_TYPE {
+    ALL_COLUMNS, ALL_COLUMNS_IN_CF, ONE_COLUMN_IN_CF, ONE_COLUMN_IN_SYSTEM
+  }
+
+  public static Collection<String> systemCols;
+  private List<String> sqlColumnNames;
+  private String tableName;
+  private Map<String, Set<String>> columnFamilies;
+
+  static {
+    systemCols = new HashSet<String>();
+    systemCols.add(ROWID);
+    systemCols.add(SCORE);
+    systemCols.add(LOCATIONID);
+    systemCols.add(FAMILY);
+    systemCols.add(RECORDID);
+  }
+
+  public BlurResultSetMetaData(List<String> queryColumnNames, Map<String, Set<String>> columnFamilies) {
+    this.columnFamilies = columnFamilies;
+    this.sqlColumnNames = new ArrayList<String>();
+    this.sqlColumnNames.add(null);
+    for (String queryColumnName : queryColumnNames) {
+      addReturnColumns(queryColumnName);
+    }
+  }
+
+  private void addReturnColumns(String queryColumnName) {
+    String col = queryColumnName.trim();
+    if ("*".equals(col)) {
+      addAllColumns();
+      return;
+    }
+    int index = col.indexOf('.');
+    if (index < 0) {
+      addSystemColumn(col);
+      return;
+    }
+    String columnFamily = col.substring(0, index);
+    String columnName = col.substring(index + 1);
+    if ("*".equals(columnName)) {
+      addColumnFamily(columnFamily);
+      return;
+    }
+    addColumn(columnFamily, columnName);
+  }
+
+  private void addColumn(String columnFamily, String columnName) {
+    sqlColumnNames.add(columnFamily + "." + columnName);
+  }
+
+  private void addColumnFamily(String columnFamily) {
+    Set<String> columns = columnFamilies.get(columnFamily);
+    if (columns == null) {
+      throw new RuntimeException("Column family [" + columnFamily + "] not found.");
+    }
+    for (String columnName : columns) {
+      addColumn(columnFamily, columnName);
+    }
+  }
+
+  private void addSystemColumn(String col) {
+    String lcCol = col.toLowerCase();
+    if (systemCols.contains(lcCol)) {
+      sqlColumnNames.add(lcCol);
+      return;
+    }
+    throw new RuntimeException("System column [" + col + "] not found.");
+  }
+
+  private void addAllColumns() {
+    sqlColumnNames.add(ROWID);
+    sqlColumnNames.add(FAMILY);
+    sqlColumnNames.add(RECORDID);
+    Map<String, Set<String>> columnFamilies = new TreeMap<String, Set<String>>(this.columnFamilies);
+    for (String family : columnFamilies.keySet()) {
+      Set<String> columnNames = columnFamilies.get(family);
+      for (String columnName : columnNames) {
+        sqlColumnNames.add(family + "." + columnName);
+      }
+    }
+  }
+
+  @Override
+  public String getColumnClassName(int column) throws SQLException {
+    return "java.lang.String";
+  }
+
+  @Override
+  public int getColumnType(int column) throws SQLException {
+    return Types.VARCHAR;
+  }
+
+  @Override
+  public int getColumnCount() throws SQLException {
+    return sqlColumnNames.size() - 1;
+  }
+
+  @Override
+  public String getColumnName(int column) throws SQLException {
+    return sqlColumnNames.get(column);
+  }
+
+  @Override
+  public String getColumnTypeName(int column) throws SQLException {
+    return "string";
+  }
+
+  @Override
+  public int getPrecision(int column) throws SQLException {
+    return 4000;
+  }
+
+  @Override
+  public int getScale(int column) throws SQLException {
+    return 0;
+  }
+
+  @Override
+  public String getCatalogName(int column) throws SQLException {
+    return "";
+  }
+
+  @Override
+  public String getSchemaName(int column) throws SQLException {
+    return "";
+  }
+
+  @Override
+  public String getTableName(int column) throws SQLException {
+    return tableName;
+  }
+
+  @Override
+  public int isNullable(int column) throws SQLException {
+    return ResultSetMetaData.columnNullable;
+  }
+
+  @Override
+  public int getColumnDisplaySize(int column) throws SQLException {
+    return 100;
+  }
+
+  @Override
+  public String getColumnLabel(int column) throws SQLException {
+    return getColumnName(column);
+  }
+
+  @Override
+  public boolean isAutoIncrement(int column) throws SQLException {
+    return false;
+  }
+
+  @Override
+  public boolean isCaseSensitive(int column) throws SQLException {
+    return true;
+  }
+
+  @Override
+  public boolean isCurrency(int column) throws SQLException {
+    return false;
+  }
+
+  @Override
+  public boolean isDefinitelyWritable(int column) throws SQLException {
+    return false;
+  }
+
+  @Override
+  public boolean isReadOnly(int column) throws SQLException {
+    return true;
+  }
+
+  @Override
+  public boolean isSearchable(int column) throws SQLException {
+    return true;
+  }
+
+  @Override
+  public boolean isSigned(int column) throws SQLException {
+    return false;
+  }
+
+  @Override
+  public boolean isWritable(int column) throws SQLException {
+    return false;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRecords.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRecords.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRecords.java
new file mode 100644
index 0000000..c7c54cb
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRecords.java
@@ -0,0 +1,247 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import static org.apache.blur.jdbc.BlurResultSetMetaData.FAMILY;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.LOCATIONID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.RECORDID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.ROWID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.SCORE;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurResultSet;
+import org.apache.blur.jdbc.parser.Parser;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.BlurQuery;
+import org.apache.blur.thrift.generated.BlurResult;
+import org.apache.blur.thrift.generated.BlurResults;
+import org.apache.blur.thrift.generated.Column;
+import org.apache.blur.thrift.generated.FetchResult;
+import org.apache.blur.thrift.generated.Record;
+import org.apache.blur.thrift.generated.Schema;
+import org.apache.blur.thrift.generated.Selector;
+import org.apache.blur.thrift.generated.SimpleQuery;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.thrift.TException;
+
+
+public class BlurResultSetRecords extends AbstractBlurResultSet {
+
+  private Selector selector;
+  private BlurResults results;
+  private int resultPosition = -1;
+  private int size;
+  private String tableName;
+  private FetchResult fetchResult;
+  private BlurResultSetMetaData blurResultSetMetaData;
+  private String lastValue;
+  private List<List<String>> displayRows = new ArrayList<List<String>>();
+  private int displayRowsPosition;
+  private Schema schema;
+  private final Iface client;
+  private long totalResults;
+  private int overallRowPosition;
+  private int currentFetch;
+  private int currentStart;
+  private Parser parser;
+  private List<String> columnNames;
+  private String columnFamily;
+
+  public BlurResultSetRecords(Iface client, Parser parser) throws SQLException {
+    this.client = client;
+    this.parser = parser;
+    String tName = parser.getTableName();
+    int lastIndexOf = tName.lastIndexOf('.');
+    tableName = tName.substring(0, lastIndexOf);
+    columnFamily = tName.substring(lastIndexOf + 1);
+    columnNames = parser.getColumnNames();
+    runSearch(0, 100);
+  }
+
+  private void runSearch(int start, int fetch) throws SQLException {
+    currentStart = start;
+    currentFetch = fetch;
+    BlurQuery blurQuery = new BlurQuery();
+    blurQuery.minimumNumberOfResults = Long.MAX_VALUE;
+    blurQuery.maxQueryTime = Long.MAX_VALUE;
+    blurQuery.uuid = new Random().nextLong();
+    blurQuery.fetch = fetch;
+    blurQuery.start = start;
+    blurQuery.simpleQuery = new SimpleQuery();
+    blurQuery.simpleQuery.queryStr = parser.getWhere();
+    blurQuery.simpleQuery.superQueryOn = false;
+
+    try {
+      schema = client.schema(tableName);
+    } catch (BlurException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    } catch (TException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    }
+
+    selector = new Selector();
+    setupSelector(selector, schema, columnNames);
+    selector.recordOnly = !blurQuery.simpleQuery.superQueryOn;
+    Map<String, Set<String>> columnFamilies = schema.columnFamilies;
+    Set<String> cfSet = columnFamilies.get(columnFamily);
+    columnFamilies.clear();
+    columnFamilies.put(columnFamily, cfSet);
+    blurResultSetMetaData = new BlurResultSetMetaData(columnNames, columnFamilies);
+    try {
+      results = client.query(tableName, blurQuery);
+    } catch (BlurException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    } catch (TException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    }
+    if (results.totalResults > 0) {
+      size = results.results.size();
+    }
+    totalResults = results.totalResults;
+  }
+
+  private void setupSelector(Selector selector, Schema schema, List<String> columnNames) {
+
+  }
+
+  @Override
+  public ResultSetMetaData getMetaData() throws SQLException {
+    return blurResultSetMetaData;
+  }
+
+  @Override
+  public boolean next() throws SQLException {
+    if (displayRows != null && displayRowsPosition + 1 < displayRows.size()) {
+      overallRowPosition++;
+      displayRowsPosition++;
+      return true;
+    } else if (resultPosition + 1 < size) {
+      INNER: while (resultPosition + 1 < size) {
+        displayRows.clear();
+        resultPosition++;
+        displayRowsPosition = 0;
+        overallRowPosition++;
+
+        final BlurResult result = results.results.get(resultPosition);
+        try {
+          selector.setLocationId(result.getLocationId());
+          fetchResult = client.fetchRow(tableName, selector);
+          Record record = fetchResult.recordResult.record;
+          if (!record.family.equals(columnFamily)) {
+            continue INNER;
+          }
+          String rowId = fetchResult.recordResult.rowid;
+          displayRows.add(addColumns(result.getScore(), result.getLocationId(), rowId, record.family, record));
+          return true;
+
+        } catch (Exception e) {
+          e.printStackTrace();
+          throw new SQLException(e);
+        }
+      }
+      return next();
+    } else if (overallRowPosition < totalResults) {
+      currentStart += currentFetch;
+      runSearch(currentStart, currentFetch);
+      displayRowsPosition = 0;
+      resultPosition = -1;
+      return next();
+    }
+    return false;
+  }
+
+  private List<String> addColumns(double score, String locationId, String rowId, String family, Record record) throws SQLException {
+    int columnCount = blurResultSetMetaData.getColumnCount();
+    List<String> result = new ArrayList<String>(columnCount + 1);
+    for (int i = 0; i < columnCount + 1; i++) {
+      result.add(null);
+    }
+    for (int i = 1; i <= columnCount; i++) {
+      String columnName = blurResultSetMetaData.getColumnName(i);
+      if (columnName.equals(ROWID)) {
+        result.set(i, rowId);
+      } else if (columnName.equals(SCORE)) {
+        result.set(i, Double.toString(score));
+      } else if (columnName.equals(LOCATIONID)) {
+        result.set(i, locationId);
+      } else if (columnName.equals(FAMILY)) {
+        result.set(i, family);
+      } else if (columnName.equals(RECORDID)) {
+        result.set(i, record.recordId);
+      } else {
+        String value = getValue(record, columnName, family);
+        result.set(i, value);
+      }
+    }
+    return result;
+  }
+
+  private String getValue(Record record, String columnNameWithFamilyName, String family) {
+    int index = columnNameWithFamilyName.indexOf('.');
+    if (family.equals(columnNameWithFamilyName.substring(0, index))) {
+      String columnName = columnNameWithFamilyName.substring(index + 1);
+      List<String> values = new ArrayList<String>();
+      for (Column col : record.columns) {
+        if (columnName.equals(col.getName())) {
+          values.add(col.getValue());
+        }
+      }
+      if (values.size() == 1) {
+        return values.get(0);
+      } else {
+        return values.toString();
+      }
+    } else {
+      return null;
+    }
+  }
+
+  @Override
+  public String getString(int columnIndex) throws SQLException {
+    return lastValue = displayRows.get(displayRowsPosition).get(columnIndex);
+  }
+
+  @Override
+  public boolean wasNull() throws SQLException {
+    if (lastValue == null) {
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public void close() throws SQLException {
+
+  }
+
+  @Override
+  public SQLWarning getWarnings() throws SQLException {
+    return new BlurWarnings();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRows.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRows.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRows.java
new file mode 100644
index 0000000..bb2a510
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetRows.java
@@ -0,0 +1,234 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import static org.apache.blur.jdbc.BlurResultSetMetaData.FAMILY;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.LOCATIONID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.RECORDID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.ROWID;
+import static org.apache.blur.jdbc.BlurResultSetMetaData.SCORE;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurResultSet;
+import org.apache.blur.jdbc.parser.Parser;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.BlurQuery;
+import org.apache.blur.thrift.generated.BlurResult;
+import org.apache.blur.thrift.generated.BlurResults;
+import org.apache.blur.thrift.generated.Column;
+import org.apache.blur.thrift.generated.FetchResult;
+import org.apache.blur.thrift.generated.Record;
+import org.apache.blur.thrift.generated.Row;
+import org.apache.blur.thrift.generated.Schema;
+import org.apache.blur.thrift.generated.Selector;
+import org.apache.blur.thrift.generated.SimpleQuery;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.thrift.TException;
+
+
+public class BlurResultSetRows extends AbstractBlurResultSet {
+
+  private Selector selector;
+  private BlurResults results;
+  private int resultPosition = -1;
+  private int size;
+  private String tableName;
+  private FetchResult fetchResult;
+  private BlurResultSetMetaData blurResultSetMetaData;
+  private String lastValue;
+  private List<List<String>> displayRows = new ArrayList<List<String>>();
+  private int displayRowsPosition;
+  private Schema schema;
+  private final Iface client;
+  private long totalResults;
+  private int overallRowPosition;
+  private int currentFetch;
+  private int currentStart;
+  private Parser parser;
+  private List<String> columnNames;
+
+  public BlurResultSetRows(Iface client, Parser parser) throws SQLException {
+    this.client = client;
+    this.parser = parser;
+    tableName = parser.getTableName();
+    columnNames = parser.getColumnNames();
+    System.out.println(columnNames);
+    runSearch(0, 100);
+  }
+
+  private void runSearch(int start, int fetch) throws SQLException {
+    currentStart = start;
+    currentFetch = fetch;
+    BlurQuery blurQuery = new BlurQuery();
+    blurQuery.minimumNumberOfResults = Long.MAX_VALUE;
+    blurQuery.maxQueryTime = Long.MAX_VALUE;
+    blurQuery.uuid = new Random().nextLong();
+    blurQuery.fetch = fetch;
+    blurQuery.start = start;
+    blurQuery.simpleQuery = new SimpleQuery();
+    blurQuery.simpleQuery.queryStr = parser.getWhere();
+    blurQuery.simpleQuery.superQueryOn = true;
+
+    try {
+      schema = client.schema(tableName);
+    } catch (BlurException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    } catch (TException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    }
+
+    selector = new Selector();
+    setupSelector(selector, schema, columnNames);
+    selector.recordOnly = !blurQuery.simpleQuery.superQueryOn;
+    blurResultSetMetaData = new BlurResultSetMetaData(columnNames, schema.columnFamilies);
+    try {
+      results = client.query(tableName, blurQuery);
+    } catch (BlurException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    } catch (TException e) {
+      e.printStackTrace();
+      throw new SQLException(e);
+    }
+    if (results.totalResults > 0) {
+      size = results.results.size();
+    }
+    totalResults = results.totalResults;
+  }
+
+  private void setupSelector(Selector selector, Schema schema, List<String> columnNames) {
+
+  }
+
+  @Override
+  public ResultSetMetaData getMetaData() throws SQLException {
+    return blurResultSetMetaData;
+  }
+
+  @Override
+  public boolean next() throws SQLException {
+    if (displayRows != null && displayRowsPosition + 1 < displayRows.size()) {
+      overallRowPosition++;
+      displayRowsPosition++;
+      return true;
+    } else if (resultPosition + 1 < size) {
+      displayRows.clear();
+      resultPosition++;
+      displayRowsPosition = 0;
+      final BlurResult result = results.results.get(resultPosition);
+      try {
+        selector.setLocationId(result.getLocationId());
+        fetchResult = client.fetchRow(tableName, selector);
+        Row row = fetchResult.rowResult.row;
+        String rowId = row.id;
+        List<Record> records = row.records;
+        for (Record record : records) {
+          displayRows.add(addColumns(result.getScore(), result.getLocationId(), rowId, record.family, record));
+        }
+        overallRowPosition++;
+        return true;
+      } catch (Exception e) {
+        e.printStackTrace();
+        throw new SQLException(e);
+      }
+    } else if (overallRowPosition < totalResults) {
+      currentStart += currentFetch;
+      runSearch(currentStart, currentFetch);
+      displayRowsPosition = 0;
+      resultPosition = -1;
+      return next();
+    }
+    return false;
+  }
+
+  private List<String> addColumns(double score, String locationId, String rowId, String family, Record record) throws SQLException {
+    int columnCount = blurResultSetMetaData.getColumnCount();
+    List<String> result = new ArrayList<String>(columnCount + 1);
+    for (int i = 0; i < columnCount + 1; i++) {
+      result.add(null);
+    }
+    for (int i = 1; i <= columnCount; i++) {
+      String columnName = blurResultSetMetaData.getColumnName(i);
+      if (columnName.equals(ROWID)) {
+        result.set(i, rowId);
+      } else if (columnName.equals(SCORE)) {
+        result.set(i, Double.toString(score));
+      } else if (columnName.equals(LOCATIONID)) {
+        result.set(i, locationId);
+      } else if (columnName.equals(FAMILY)) {
+        result.set(i, family);
+      } else if (columnName.equals(RECORDID)) {
+        result.set(i, record.recordId);
+      } else {
+        String value = getValue(record, columnName, family);
+        result.set(i, value);
+      }
+    }
+    return result;
+  }
+
+  private String getValue(Record record, String columnNameWithFamilyName, String family) {
+    int index = columnNameWithFamilyName.indexOf('.');
+    if (family.equals(columnNameWithFamilyName.substring(0, index))) {
+      String columnName = columnNameWithFamilyName.substring(index + 1);
+      List<String> values = new ArrayList<String>();
+      for (Column col : record.columns) {
+        if (columnName.equals(col.getName())) {
+          values.add(col.getValue());
+        }
+      }
+      if (values.size() == 1) {
+        return values.get(0);
+      } else {
+        return values.toString();
+      }
+    } else {
+      return null;
+    }
+  }
+
+  @Override
+  public String getString(int columnIndex) throws SQLException {
+    return lastValue = displayRows.get(displayRowsPosition).get(columnIndex);
+  }
+
+  @Override
+  public boolean wasNull() throws SQLException {
+    if (lastValue == null) {
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public void close() throws SQLException {
+
+  }
+
+  @Override
+  public SQLWarning getWarnings() throws SQLException {
+    return new BlurWarnings();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetTest.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetTest.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetTest.java
new file mode 100644
index 0000000..705e43f
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurResultSetTest.java
@@ -0,0 +1,56 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.ResultSetMetaData;
+import java.util.List;
+
+import org.apache.blur.jdbc.parser.Parser;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.BlurClientManager;
+import org.apache.blur.thrift.Connection;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class BlurResultSetTest {
+
+  public static void main(String[] args) throws Exception {
+    // String sql = "select * from test-table.fam0 where fam0.col0 = 'abroad'";
+    String sql = "select * from test-table.fam0";
+    List<Connection> connections = BlurClientManager.getConnections("10.192.56.10:40010");
+    // BlurResultSetRows resultSet = new BlurResultSetRows(sql,connections);
+
+    Iface client = BlurClient.getClient(connections);
+    Parser parser = new Parser();
+    parser.parse(sql);
+
+    BlurResultSetRecords resultSet = new BlurResultSetRecords(client, parser);
+    int c = 0;
+    while (resultSet.next()) {
+      System.out.println(c + " ------------------------");
+      ResultSetMetaData metaData = resultSet.getMetaData();
+      int columnCount = metaData.getColumnCount();
+      for (int i = 1; i <= columnCount; i++) {
+        String value = resultSet.getString(i);
+        String name = metaData.getColumnName(i);
+        System.out.println("\t" + name + ":[" + value + "]");
+      }
+      c++;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurStatement.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurStatement.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurStatement.java
new file mode 100644
index 0000000..7e622f0
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurStatement.java
@@ -0,0 +1,139 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.List;
+
+import org.apache.blur.jdbc.abstractimpl.AbstractBlurStatement;
+import org.apache.blur.jdbc.parser.Parser;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.thrift.TException;
+
+
+public class BlurStatement extends AbstractBlurStatement {
+
+  private BlurConnection connection;
+  private int maxRows;
+  private String sql;
+
+  public BlurStatement(BlurConnection connection) {
+    this.connection = connection;
+  }
+
+  public int getMaxRows() throws SQLException {
+    return maxRows;
+  }
+
+  public void setMaxRows(int maxRows) throws SQLException {
+    this.maxRows = maxRows;
+  }
+
+  public int getUpdateCount() throws SQLException {
+    return -1;
+  }
+
+  @Override
+  public ResultSet executeQuery(String sql) throws SQLException {
+    execute(sql);
+    return getResultSet();
+  }
+
+  public boolean execute(String sql) throws SQLException {
+    this.sql = sql;
+    return true;
+  }
+
+  public ResultSet getResultSet() throws SQLException {
+    try {
+      System.out.println(sql);
+      Iface client = BlurClient.getClient(connection.getHost() + ":" + connection.getPort());
+      Parser parser = new Parser();
+      parser.parse(sql);
+      if (isSuperQuery(parser, client)) {
+        return new BlurResultSetRows(client, parser);
+      } else {
+        return new BlurResultSetRecords(client, parser);
+      }
+
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw new SQLException("Unknown Error", e);
+    }
+  }
+
+  private boolean isSuperQuery(Parser parser, Iface client) throws BlurException, TException, SQLException {
+    String tableName = parser.getTableName();
+    List<String> tableList = client.tableList();
+    if (tableList.contains(tableName)) {
+      return true;
+    }
+    int lastIndexOf = tableName.lastIndexOf('.');
+    if (tableList.contains(tableName.substring(0, lastIndexOf))) {
+      return false;
+    }
+    throw new SQLException("Table [" + tableName + "] does not exist.");
+  }
+
+  public void addBatch(String s) throws SQLException {
+
+  }
+
+  public void cancel() throws SQLException {
+
+    // @TODO fix this
+
+    // try {
+    // BlurClientManager.execute(connection.getHost() + ":" +
+    // connection.getPort(), new BlurCommand<Void>() {
+    // @Override
+    // public Void call(Client client) throws Exception {
+    // client.cancelQuery(uuid);
+    // return null;
+    // }
+    // });
+    // } catch (Exception e) {
+    // throw new SQLException(e);
+    // }
+  }
+
+  public void clearBatch() throws SQLException {
+
+  }
+
+  public void clearWarnings() throws SQLException {
+
+  }
+
+  public void close() throws SQLException {
+
+  }
+
+  public Connection getConnection() throws SQLException {
+    return connection;
+  }
+
+  public SQLWarning getWarnings() throws SQLException {
+    return new BlurWarnings();
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurWarnings.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurWarnings.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurWarnings.java
new file mode 100644
index 0000000..da31cb6
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/BlurWarnings.java
@@ -0,0 +1,25 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.sql.SQLWarning;
+
+public class BlurWarnings extends SQLWarning {
+
+  private static final long serialVersionUID = 9142092749428230656L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/QueryData.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/QueryData.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/QueryData.java
new file mode 100644
index 0000000..d95049e
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/QueryData.java
@@ -0,0 +1,72 @@
+package org.apache.blur.jdbc;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+public class QueryData {
+
+  protected String name;
+  protected String alias;
+
+  public QueryData(String name, String alias) {
+    this.name = name;
+    this.alias = alias;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public String getAlias() {
+    return alias;
+  }
+
+  @Override
+  public String toString() {
+    return "QueryData [name=" + name + ", alias=" + alias + "]";
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((alias == null) ? 0 : alias.hashCode());
+    result = prime * result + ((name == null) ? 0 : name.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null)
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    QueryData other = (QueryData) obj;
+    if (alias == null) {
+      if (other.alias != null)
+        return false;
+    } else if (!alias.equals(other.alias))
+      return false;
+    if (name == null) {
+      if (other.name != null)
+        return false;
+    } else if (!name.equals(other.name))
+      return false;
+    return true;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33df9310/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/abstractimpl/AbstractBlurConnection.java
----------------------------------------------------------------------
diff --git a/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/abstractimpl/AbstractBlurConnection.java b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/abstractimpl/AbstractBlurConnection.java
new file mode 100644
index 0000000..ae9a642
--- /dev/null
+++ b/src/blur-jdbc/src/main/java/org/apache/blur/jdbc/abstractimpl/AbstractBlurConnection.java
@@ -0,0 +1,252 @@
+package org.apache.blur.jdbc.abstractimpl;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.blur.jdbc.util.NotImplemented;
+
+
+public abstract class AbstractBlurConnection implements Connection {
+
+  private Connection throwExceptionDelegate;
+
+  public AbstractBlurConnection() {
+    throwExceptionDelegate = (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, new InvocationHandler() {
+      @Override
+      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        throw new NotImplemented(method.getName());
+      }
+    });
+  }
+
+  public void clearWarnings() throws SQLException {
+    throwExceptionDelegate.clearWarnings();
+  }
+
+  public void close() throws SQLException {
+    throwExceptionDelegate.close();
+  }
+
+  public void commit() throws SQLException {
+    throwExceptionDelegate.commit();
+  }
+
+  public Array createArrayOf(String arg0, Object[] arg1) throws SQLException {
+    return throwExceptionDelegate.createArrayOf(arg0, arg1);
+  }
+
+  public Blob createBlob() throws SQLException {
+    return throwExceptionDelegate.createBlob();
+  }
+
+  public Clob createClob() throws SQLException {
+    return throwExceptionDelegate.createClob();
+  }
+
+  public NClob createNClob() throws SQLException {
+    return throwExceptionDelegate.createNClob();
+  }
+
+  public SQLXML createSQLXML() throws SQLException {
+    return throwExceptionDelegate.createSQLXML();
+  }
+
+  public Statement createStatement() throws SQLException {
+    return throwExceptionDelegate.createStatement();
+  }
+
+  public Statement createStatement(int arg0, int arg1, int arg2) throws SQLException {
+    return throwExceptionDelegate.createStatement(arg0, arg1, arg2);
+  }
+
+  public Statement createStatement(int arg0, int arg1) throws SQLException {
+    return throwExceptionDelegate.createStatement(arg0, arg1);
+  }
+
+  public Struct createStruct(String arg0, Object[] arg1) throws SQLException {
+    return throwExceptionDelegate.createStruct(arg0, arg1);
+  }
+
+  public boolean getAutoCommit() throws SQLException {
+    return throwExceptionDelegate.getAutoCommit();
+  }
+
+  public String getCatalog() throws SQLException {
+    return throwExceptionDelegate.getCatalog();
+  }
+
+  public Properties getClientInfo() throws SQLException {
+    return throwExceptionDelegate.getClientInfo();
+  }
+
+  public String getClientInfo(String arg0) throws SQLException {
+    return throwExceptionDelegate.getClientInfo(arg0);
+  }
+
+  public int getHoldability() throws SQLException {
+    return throwExceptionDelegate.getHoldability();
+  }
+
+  public DatabaseMetaData getMetaData() throws SQLException {
+    return throwExceptionDelegate.getMetaData();
+  }
+
+  public int getTransactionIsolation() throws SQLException {
+    return throwExceptionDelegate.getTransactionIsolation();
+  }
+
+  public Map<String, Class<?>> getTypeMap() throws SQLException {
+    return throwExceptionDelegate.getTypeMap();
+  }
+
+  public SQLWarning getWarnings() throws SQLException {
+    return throwExceptionDelegate.getWarnings();
+  }
+
+  public boolean isClosed() throws SQLException {
+    return throwExceptionDelegate.isClosed();
+  }
+
+  public boolean isReadOnly() throws SQLException {
+    return throwExceptionDelegate.isReadOnly();
+  }
+
+  public boolean isValid(int arg0) throws SQLException {
+    return throwExceptionDelegate.isValid(arg0);
+  }
+
+  public boolean isWrapperFor(Class<?> iface) throws SQLException {
+    return throwExceptionDelegate.isWrapperFor(iface);
+  }
+
+  public String nativeSQL(String arg0) throws SQLException {
+    return throwExceptionDelegate.nativeSQL(arg0);
+  }
+
+  public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException {
+    return throwExceptionDelegate.prepareCall(arg0, arg1, arg2, arg3);
+  }
+
+  public CallableStatement prepareCall(String arg0, int arg1, int arg2) throws SQLException {
+    return throwExceptionDelegate.prepareCall(arg0, arg1, arg2);
+  }
+
+  public CallableStatement prepareCall(String arg0) throws SQLException {
+    return throwExceptionDelegate.prepareCall(arg0);
+  }
+
+  public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2, arg3);
+  }
+
+  public PreparedStatement prepareStatement(String arg0, int arg1, int arg2) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2);
+  }
+
+  public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0, arg1);
+  }
+
+  public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0, arg1);
+  }
+
+  public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0, arg1);
+  }
+
+  public PreparedStatement prepareStatement(String arg0) throws SQLException {
+    return throwExceptionDelegate.prepareStatement(arg0);
+  }
+
+  public void releaseSavepoint(Savepoint arg0) throws SQLException {
+    throwExceptionDelegate.releaseSavepoint(arg0);
+  }
+
+  public void rollback() throws SQLException {
+    throwExceptionDelegate.rollback();
+  }
+
+  public void rollback(Savepoint arg0) throws SQLException {
+    throwExceptionDelegate.rollback(arg0);
+  }
+
+  public void setAutoCommit(boolean arg0) throws SQLException {
+    throwExceptionDelegate.setAutoCommit(arg0);
+  }
+
+  public void setCatalog(String arg0) throws SQLException {
+    throwExceptionDelegate.setCatalog(arg0);
+  }
+
+  public void setClientInfo(Properties arg0) throws SQLClientInfoException {
+    throwExceptionDelegate.setClientInfo(arg0);
+  }
+
+  public void setClientInfo(String arg0, String arg1) throws SQLClientInfoException {
+    throwExceptionDelegate.setClientInfo(arg0, arg1);
+  }
+
+  public void setHoldability(int arg0) throws SQLException {
+    throwExceptionDelegate.setHoldability(arg0);
+  }
+
+  public void setReadOnly(boolean arg0) throws SQLException {
+    throwExceptionDelegate.setReadOnly(arg0);
+  }
+
+  public Savepoint setSavepoint() throws SQLException {
+    return throwExceptionDelegate.setSavepoint();
+  }
+
+  public Savepoint setSavepoint(String arg0) throws SQLException {
+    return throwExceptionDelegate.setSavepoint(arg0);
+  }
+
+  public void setTransactionIsolation(int arg0) throws SQLException {
+    throwExceptionDelegate.setTransactionIsolation(arg0);
+  }
+
+  public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException {
+    throwExceptionDelegate.setTypeMap(arg0);
+  }
+
+  public <T> T unwrap(Class<T> iface) throws SQLException {
+    return throwExceptionDelegate.unwrap(iface);
+  }
+
+}


Mime
View raw message