1 package com.daffodilwoods.daffodildb.odbc; 2 3 import java.text.*; 4 5 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata.*; 6 import com.daffodilwoods.database.general.*; 7 import com.daffodilwoods.database.resource.*; 8 import com.daffodilwoods.database.utility.*; 9 import com.daffodilwoods.daffodildb.server.datadictionarysystem._ColumnCharacteristics; 10 11 23 24 public class TempColumnCharacteristics implements _SelectColumnCharacteristics, _RowReader { 25 Object [][] columnCharacteristics; 26 String [] columns; 27 public TempColumnCharacteristics(Object [][] columnCharacteristics0, String [] columns0) { 28 this.columnCharacteristics = columnCharacteristics0; 29 this.columns = columns0; 30 } 31 32 public boolean isColumnUpdatable(int parm1) throws DException { 33 return false; 34 } 35 36 public boolean isUpdatable() throws DException { 37 return false; 38 } 39 40 public boolean isColumnSelectable(int parm1) throws DException { 41 return true; 42 } 43 44 public _SelectColumnCharacteristics getColumnCharacteristics(int parm1) throws 45 DException { 46 return this; 47 } 48 49 public boolean isForeignTableRecordFetched(int parm1) throws DException { 50 return false; 51 } 52 53 public int getColumnType(int parm1) throws DException { 54 int column = getValidColumn(parm1); 55 return columnCharacteristics[column][4].hashCode(); 56 } 57 58 public String getColumnName(int parm1) throws DException { 59 int column = getValidColumn(parm1); 60 return (String ) columnCharacteristics[column][3]; 61 } 62 63 public String getRelatedTable(int parm1) throws DatabaseException, DException { 64 return null; 65 } 66 67 public int getColumnCount() throws DException { 68 return columnCharacteristics.length; 69 } 70 71 public int getSize(int parm1) throws DException { 72 int column = getValidColumn(parm1); 73 return columnCharacteristics[column][10].hashCode(); 74 } 75 76 public String getTableName(int parm1) throws DatabaseException, DException { 77 int column = getValidColumn(parm1); 78 return (String ) columnCharacteristics[column][2]; 79 } 80 81 public int getPrecision(int parm1) throws DException { 82 int column = getValidColumn(parm1); 83 return columnCharacteristics[column][6].hashCode(); 84 } 85 86 public int getScale(int parm1) throws DException { 87 int column = getValidColumn(parm1); 88 return columnCharacteristics[column][7].hashCode(); 89 } 90 91 public String getSchemaName(int parm1) throws DException { 92 int column = getValidColumn(parm1); 93 return (String ) columnCharacteristics[column][1]; 94 } 95 96 public String getCatalogName(int parm1) throws DException { 97 int column = getValidColumn(parm1); 98 return (String ) columnCharacteristics[column][0]; 99 } 100 101 public int isNullable(int parm1) throws DException { 102 int column = getValidColumn(parm1); 103 return columnCharacteristics[column][9].hashCode(); 104 } 105 106 public boolean isAutoIncrement(int parm1) throws DException { 107 return false; 108 } 109 110 public String getColumnLabel(int parm1) throws DException { 111 int column = getValidColumn(parm1); 112 return (String ) columnCharacteristics[column][5]; 113 } 114 115 public String [] getRelatedColumns(int parm1) throws DatabaseException, 116 DException { 117 return null; 118 } 119 120 public Collator getCollator() throws DException { 121 return null; 122 } 123 124 125 public int getColumnIndex(String parm1) throws DException { 126 int index = P.indexOfIgnoreCase(columns, parm1); 127 if (index == -1) 128 throw new DException("DSEClient column {0} not found", 129 new Object [] {parm1}); 130 return index + 1; 131 } 132 133 public String [] getColumnNames() throws DException { 134 return this.columns; 135 } 136 137 public int[] getColumnIndexes(String [] parm1) throws DException { 138 int len = parm1.length; 139 int[] columnIndexes = new int[len]; 140 for (int i = 0; i < len; i++) { 141 columnIndexes[i] = getColumnIndex(parm1[i]); 142 } 143 return columnIndexes; 144 } 145 146 147 public Object getObject(int int0, Object object) throws DException { 148 int columnIndex = getValidColumn(int0); 149 return object == null ? null : ( (Object []) object)[columnIndex]; 150 } 151 152 public void setObject(int int0, Object object, Object object2) throws DException { 153 throw new java.lang.UnsupportedOperationException ( 154 "Method setObject() not yet implemented."); 155 } 156 157 private int getValidColumn(int column) throws DException { 158 if (columnCharacteristics == null || column < 1 || 159 column > columnCharacteristics.length) { 160 DException dex = new DException("DSE737", null); 161 throw dex; 162 } 163 return column - 1; 164 } 165 166 167 168 public String getExpression(int parm1) throws DException { 169 throw new java.lang.UnsupportedOperationException ( 170 "Method getExpression() not yet implemented."); 171 } 172 173 public Object [] getCorresspondingColumnsForFromSubQueryColumn( 174 Object parm1) throws DException { 175 throw new java.lang.UnsupportedOperationException ( 176 "Method getCorresspondingColumnsForFromSubQueryColumn() not yet implemented."); 177 } 178 179 public String [] getPrimaryKeys() throws DatabaseException, DException { 180 throw new java.lang.UnsupportedOperationException ( 181 "Method getPrimaryKeys() not yet implemented."); 182 } 183 184 public String getRelation(int parm1) throws DatabaseException, DException { 185 throw new java.lang.UnsupportedOperationException ( 186 "Method getRelation() not yet implemented."); 187 } 188 189 public int[] getPrimaryConditionColumns() throws DException { 190 throw new java.lang.UnsupportedOperationException ( 191 "Method getPrimaryConditionColumns() not yet implemented."); 192 } 193 194 public String getQualifiedTableName(int parm1) throws DException { 195 throw new java.lang.UnsupportedOperationException ( 196 "Method getQualifiedTableName() not yet implemented."); 197 } 198 199 public short getTableType() throws DException { 200 throw new java.lang.UnsupportedOperationException ( 201 "Method getTableType() not yet implemented."); 202 } 203 204 public _ColumnCharacteristics getCCFromIndexes(_ColumnCharacteristics cc, int offset, int[] columnIndexes) throws DException { 205 throw new UnsupportedOperationException ("getCCFromIndexes(cc, offset, columnIndexes) method not implemented yet"); 206 } 207 } 208 | Popular Tags |