1 21 22 package org.apache.derby.impl.load; 23 24 import java.sql.SQLException ; 25 import org.apache.derby.vti.VTIMetaDataTemplate; 26 27 import org.apache.derby.iapi.reference.Limits; 28 29 class ImportResultSetMetaData extends VTIMetaDataTemplate { 30 31 private final int numberOfColumns; 32 private final String [] columnNames; 33 private final int[] columnWidths; 34 35 public ImportResultSetMetaData(int numberOfColumns, String [] columnNames, 36 int[] columnWidths) { 37 this.numberOfColumns = numberOfColumns; 38 this.columnNames = columnNames; 39 this.columnWidths = columnWidths; 40 } 41 42 public int getColumnCount() { 43 return numberOfColumns; 44 } 45 46 public String getColumnName(int column) { 47 return columnNames[column-1]; 48 } 49 50 public int getColumnType(int column) { 51 return java.sql.Types.VARCHAR; 52 } 53 54 public int isNullable(int column) { 55 return columnNullableUnknown; 56 } 57 public int getColumnDisplaySize(int column) { 58 if (columnWidths == null) 59 return Limits.DB2_VARCHAR_MAXWIDTH; 60 else 61 return columnWidths[column-1]; 62 } 63 } 64 | Popular Tags |