Java Code Examples for org.apache.calcite.avatica.SqlType#BIT

The following examples show how to use org.apache.calcite.avatica.SqlType#BIT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalciteRemoteDriverTest.java    From Quicksql with MIT License 6 votes vote down vote up
/** Check that the "get" conversion table looks like Table B-5 in JDBC 4.1
 * specification */
@Test public void testTableB6() {
  SqlType[] columns = {
      SqlType.TINYINT, SqlType.SMALLINT, SqlType.INTEGER, SqlType.BIGINT,
      SqlType.REAL, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,
      SqlType.NUMERIC, SqlType.BIT, SqlType.BOOLEAN, SqlType.CHAR,
      SqlType.VARCHAR, SqlType.LONGVARCHAR, SqlType.BINARY, SqlType.VARBINARY,
      SqlType.LONGVARBINARY, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
      SqlType.CLOB, SqlType.BLOB, SqlType.ARRAY, SqlType.REF,
      SqlType.DATALINK, SqlType.STRUCT, SqlType.JAVA_OBJECT, SqlType.ROWID,
      SqlType.NCHAR, SqlType.NVARCHAR, SqlType.LONGNVARCHAR, SqlType.NCLOB,
      SqlType.SQLXML
  };
  final PrintWriter out =
      CalciteSystemProperty.DEBUG.value()
          ? Util.printWriter(System.out)
          : new PrintWriter(new StringWriter());
  for (SqlType.Method row : SqlType.Method.values()) {
    out.print(pad(row.methodName));
    for (SqlType column : columns) {
      out.print(SqlType.canGet(row, column) ? "x " : ". ");
    }
    out.println();
  }
}
 
Example 2
Source File: CalciteRemoteDriverTest.java    From calcite with Apache License 2.0 6 votes vote down vote up
/** Check that the "get" conversion table looks like Table B-5 in JDBC 4.1
 * specification */
@Test void testTableB6() {
  SqlType[] columns = {
      SqlType.TINYINT, SqlType.SMALLINT, SqlType.INTEGER, SqlType.BIGINT,
      SqlType.REAL, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,
      SqlType.NUMERIC, SqlType.BIT, SqlType.BOOLEAN, SqlType.CHAR,
      SqlType.VARCHAR, SqlType.LONGVARCHAR, SqlType.BINARY, SqlType.VARBINARY,
      SqlType.LONGVARBINARY, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
      SqlType.CLOB, SqlType.BLOB, SqlType.ARRAY, SqlType.REF,
      SqlType.DATALINK, SqlType.STRUCT, SqlType.JAVA_OBJECT, SqlType.ROWID,
      SqlType.NCHAR, SqlType.NVARCHAR, SqlType.LONGNVARCHAR, SqlType.NCLOB,
      SqlType.SQLXML
  };
  final PrintWriter out =
      CalciteSystemProperty.DEBUG.value()
          ? Util.printWriter(System.out)
          : new PrintWriter(new StringWriter());
  for (SqlType.Method row : SqlType.Method.values()) {
    out.print(pad(row.methodName));
    for (SqlType column : columns) {
      out.print(SqlType.canGet(row, column) ? "x " : ". ");
    }
    out.println();
  }
}
 
Example 3
Source File: CalciteRemoteDriverTest.java    From Quicksql with MIT License 5 votes vote down vote up
/** Check that the "set" conversion table looks like Table B-5 in JDBC 4.1
 * specification */
@Test public void testTableB5() {
  SqlType[] columns = {
      SqlType.TINYINT, SqlType.SMALLINT, SqlType.INTEGER, SqlType.BIGINT,
      SqlType.REAL, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,
      SqlType.NUMERIC, SqlType.BIT, SqlType.BOOLEAN, SqlType.CHAR,
      SqlType.VARCHAR, SqlType.LONGVARCHAR, SqlType.BINARY, SqlType.VARBINARY,
      SqlType.LONGVARBINARY, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
      SqlType.ARRAY, SqlType.BLOB, SqlType.CLOB, SqlType.STRUCT, SqlType.REF,
      SqlType.DATALINK, SqlType.JAVA_OBJECT, SqlType.ROWID, SqlType.NCHAR,
      SqlType.NVARCHAR, SqlType.LONGNVARCHAR, SqlType.NCLOB, SqlType.SQLXML
  };
  Class[] rows = {
      String.class, BigDecimal.class, Boolean.class, Byte.class, Short.class,
      Integer.class, Long.class, Float.class, Double.class, byte[].class,
      BigInteger.class, java.sql.Date.class, Time.class, Timestamp.class,
      Array.class, Blob.class, Clob.class, Struct.class, Ref.class,
      URL.class, Class.class, RowId.class, NClob.class, SQLXML.class,
      Calendar.class, Date.class
  };
  for (Class row : rows) {
    final String s = row == Date.class ? row.getName() : row.getSimpleName();
    out.print(pad(s));
    for (SqlType column : columns) {
      out.print(SqlType.canSet(row, column) ? "x " : ". ");
    }
    out.println();
  }
}
 
Example 4
Source File: CalciteRemoteDriverTest.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Check that the "set" conversion table looks like Table B-5 in JDBC 4.1
 * specification */
@Test void testTableB5() {
  SqlType[] columns = {
      SqlType.TINYINT, SqlType.SMALLINT, SqlType.INTEGER, SqlType.BIGINT,
      SqlType.REAL, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,
      SqlType.NUMERIC, SqlType.BIT, SqlType.BOOLEAN, SqlType.CHAR,
      SqlType.VARCHAR, SqlType.LONGVARCHAR, SqlType.BINARY, SqlType.VARBINARY,
      SqlType.LONGVARBINARY, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
      SqlType.ARRAY, SqlType.BLOB, SqlType.CLOB, SqlType.STRUCT, SqlType.REF,
      SqlType.DATALINK, SqlType.JAVA_OBJECT, SqlType.ROWID, SqlType.NCHAR,
      SqlType.NVARCHAR, SqlType.LONGNVARCHAR, SqlType.NCLOB, SqlType.SQLXML
  };
  Class[] rows = {
      String.class, BigDecimal.class, Boolean.class, Byte.class, Short.class,
      Integer.class, Long.class, Float.class, Double.class, byte[].class,
      BigInteger.class, java.sql.Date.class, Time.class, Timestamp.class,
      Array.class, Blob.class, Clob.class, Struct.class, Ref.class,
      URL.class, Class.class, RowId.class, NClob.class, SQLXML.class,
      Calendar.class, java.util.Date.class
  };
  for (Class row : rows) {
    final String s = row == Date.class ? row.getName() : row.getSimpleName();
    out.print(pad(s));
    for (SqlType column : columns) {
      out.print(SqlType.canSet(row, column) ? "x " : ". ");
    }
    out.println();
  }
}