Package org.apache.derby.iapi.sql

Examples of org.apache.derby.iapi.sql.ResultColumnDescriptor


   *
   * @return  A ResultDescription for this ResultSetNode.
   */
  public ResultColumnDescriptor[] makeResultDescriptors()
  {
      ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()];
    int size = size();

    for (int index = 0; index < size; index++)
    {
        // the ResultColumn nodes are descriptors, so take 'em...
View Full Code Here


            return returnValue;
        } catch (StandardException se) {
            // Catch illegal null insert and add column info
            if (se.getMessageId().startsWith(SQLState.LANG_NULL_INTO_NON_NULL))
            {
                ResultColumnDescriptor columnDescriptor = desc.getColumnDescriptor( sourceColumnPosition );
                throw StandardException.newException
                    (SQLState.LANG_NULL_INTO_NON_NULL, columnDescriptor.getName());
            }
            //just rethrow if not LANG_NULL_INTO_NON_NULL
            throw se;
        }
    }
View Full Code Here

        DataTypeDescriptor[]    result = new DataTypeDescriptor[ count ];
       
        for ( int i = 1; i <= count; i++)
        {
            ResultColumnDescriptor  colDesc = desc.getColumnDescriptori );
            DataTypeDescriptor dtd = colDesc.getType();

            result[i - 1] = dtd;
        }

        return result;
View Full Code Here

        // first count the number of generated columns
        for ( int i = 1; i <= columnCount; i++ )
        {
            if ( i < firstColumn ) { continue; }
           
            ResultColumnDescriptor  rcd = resultDescription.getColumnDescriptor( i );

            if ( rcd.hasGenerationClause() ) { generatedColumnCount++; }
        }

        // now allocate and populate support structures
        generatedColumnPositions = new int[ generatedColumnCount ];
        normalizedGeneratedValues = new DataValueDescriptor[ generatedColumnCount ];

        int     idx = 0;
        for ( int i = 1; i <= columnCount; i++ )
        {
            if ( i < firstColumn ) { continue; }
           
            ResultColumnDescriptor  rcd = resultDescription.getColumnDescriptor( i );

            if ( rcd.hasGenerationClause() )
            {
                generatedColumnPositions[ idx ] = i;
                normalizedGeneratedValues[ idx ] = emptyRow.getColumn( i );

                idx++;
View Full Code Here

   * @exception SQLException thrown on failure
     *
     */
  public final boolean isAutoIncrement(int column) throws SQLException  {
        validColumnNumber(column);
    ResultColumnDescriptor rcd = columnInfo[column - 1];
    return rcd.isAutoincrement();
  }
View Full Code Here

     * @param column the first column is 1, the second is 2, ...
     * @return true if so
   * @exception SQLException thrown on failure
     */
  public final String getColumnLabel(int column) throws SQLException {
    ResultColumnDescriptor cd = columnInfo[column - 1];
    String s = cd.getName();

    // we could get fancier than this, but it's simple
      return (s==null? "Column"+Integer.toString(column) : s);
  }
View Full Code Here

     * @param column the first column is 1, the second is 2, ...
     * @return column name
   * @exception SQLException thrown on failure
     */
  public final String getColumnName(int column) throws SQLException  {
    ResultColumnDescriptor cd = columnInfo[column - 1];
    String s = cd.getName();
    // database returns null when no column name to differentiate from empty name
      return (s==null? "" : s);

  }
View Full Code Here

     * @param column the first column is 1, the second is 2, ...
     * @return schema name or "" if not applicable
   * @exception SQLException thrown on failure
     */
  public final String getSchemaName(int column) throws SQLException  {
    ResultColumnDescriptor cd = columnInfo[column - 1];

    String s = cd.getSourceSchemaName();
    // database returns null when no schema name to differentiate from empty name
    return (s==null? "" : s);
  }
View Full Code Here

     *
     * @return table name or "" if not applicable
   * @exception SQLException thrown on failure
     */
  public final String getTableName(int column) throws SQLException {
    ResultColumnDescriptor cd = columnInfo[column - 1];
    String s = cd.getSourceTableName();

    // database returns null when no table name to differentiate from empty name
    return (s==null? "" : s);
  }
View Full Code Here

  private DataTypeDescriptor getColumnTypeDescriptor(int column) throws SQLException
  {
    validColumnNumber(column);

    ResultColumnDescriptor cd = columnInfo[column - 1];

    return cd.getType();
  }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.ResultColumnDescriptor

Copyright © 2018 www.massapicom. 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.