HttpNeo4jResultSetMetaData extends Neo4jResultSetMetaData { @SuppressWarnings("unchecked") @Override public int getColumnType(int column) throws SQLException { final Object object = ((List<Object>) this.result.getRows().get(0).get("row")).get(column - 1); if (object == null) { return Types.NULL; } for (Map.Entry<Class, Integer> entry : TYPES_ASSOCIATIONS.entrySet()) { if (entry.getKey().isInstance(object)) { return entry.getValue(); } } return Types.JAVA_OBJECT; } HttpNeo4jResultSetMetaData(Neo4jResult result); @SuppressWarnings("unchecked") @Override int getColumnType(int column); @SuppressWarnings("unchecked") @Override String getColumnClassName(int column);  }
@Test public void getColumnTypeShouldReturnTheCorrectValue() throws SQLException { assertEquals(Types.NULL, this.httpResultSetMetadata.getColumnType(1)); assertEquals(Types.VARCHAR, this.httpResultSetMetadata.getColumnType(2)); assertEquals(Types.INTEGER, this.httpResultSetMetadata.getColumnType(3)); assertEquals(Types.INTEGER, this.httpResultSetMetadata.getColumnType(4)); assertEquals(Types.BOOLEAN, this.httpResultSetMetadata.getColumnType(5)); assertEquals(Types.FLOAT, this.httpResultSetMetadata.getColumnType(6)); assertEquals(Types.FLOAT, this.httpResultSetMetadata.getColumnType(7)); assertEquals(Types.JAVA_OBJECT, this.httpResultSetMetadata.getColumnType(8)); assertEquals(Types.ARRAY, this.httpResultSetMetadata.getColumnType(9)); }