Examples of TypeId


Examples of org.apache.derby.iapi.types.TypeId

      for (int index = 1; index <= numColumns; index++)
      {
        boolean nullableResult =
          (rsmd.isNullable(index) != ResultSetMetaData.columnNoNulls);

        TypeId cti;

        int jdbcColumnType = rsmd.getColumnType(index);

        switch (jdbcColumnType) {
        case org.apache.derby.iapi.reference.JDBC20Translation.SQL_TYPES_JAVA_OBJECT:
        case Types.OTHER:
        {
          cti = TypeId.getUserDefinedTypeId(rsmd.getColumnTypeName(index), false);
          break;
        }
        default:
        {
          cti = TypeId.getBuiltInTypeId(jdbcColumnType);
          break;
        }
        }

        // Handle the case where a VTI returns a bad column type
        if (cti == null)
        {
          throw StandardException.newException(SQLState.LANG_BAD_J_D_B_C_TYPE_INFO, Integer.toString(index));
        }

        // Get the maximum byte storage for this column
        int maxWidth;

        /* Get maximum byte storage from rsmd for variable
         * width types, set it to MAXINT for the long types,
         * otherwise get it from the TypeId
         */
        if (cti.variableLength())
        {
          maxWidth = rsmd.getColumnDisplaySize(index);
        }
        else if (jdbcColumnType == Types.LONGVARCHAR ||
             jdbcColumnType == Types.LONGVARBINARY)
        {
          maxWidth = Integer.MAX_VALUE;
        }
        else
        {
          maxWidth = 0;
        }

        int precision = cti.isDecimalTypeId() ? rsmd.getPrecision(index) : 0;
        int scale = cti.isDecimalTypeId() ? rsmd.getScale(index) : 0;
        DataTypeDescriptor dts = new DataTypeDescriptor(cti,
                      precision,
                      scale,
                      nullableResult,
                      maxWidth);
View Full Code Here

Examples of org.apache.derby.iapi.types.TypeId

   * selectivity otherwise.
   */
  protected double booleanSelectivity(Optimizable optTable)
  throws StandardException
  {
    TypeId  typeId = null;
    double        retval = -1.0d;
    int          columnSide;

    columnSide = columnOnOneSide(optTable);

    if (columnSide == LEFT)
      typeId = leftOperand.getTypeId();
    else if (columnSide == RIGHT)
      typeId = rightOperand.getTypeId();

    if (typeId != null && (typeId.getJDBCTypeId() == Types.BIT ||
    typeId.getJDBCTypeId() == JDBC30Translation.SQL_TYPES_BOOLEAN))
      retval = 0.5d;

    return retval;
  }
View Full Code Here

Examples of org.apache.derby.iapi.types.TypeId

   */

  private boolean implicitVarcharComparison()
    throws StandardException
  {
    TypeId leftType = leftOperand.getTypeId();
    TypeId rightType = rightOperand.getTypeId();
   
    if (leftType.isStringTypeId() && !rightType.isStringTypeId())
      return true;

    if (rightType.isStringTypeId() && (!leftType.isStringTypeId()))
      return true;

    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.