1 22 23 package org.continuent.sequoia.driver; 24 25 import java.sql.SQLException ; 26 27 34 public class ResultSetMetaData implements java.sql.ResultSetMetaData  35 { 36 private DriverResultSet rs; 37 38 43 public ResultSetMetaData(DriverResultSet rs) 44 { 45 this.rs = rs; 46 } 47 48 51 public int getColumnCount() throws SQLException  52 { 53 return rs.nbOfColumns; 54 } 55 56 59 public boolean isAutoIncrement(int column) throws SQLException  60 { 61 if ((column < 1) || (column > rs.nbOfColumns)) 62 throw new SQLException ("Invalid column index " + column); 63 return rs.fields[column - 1].isAutoIncrement(); 64 } 65 66 69 public boolean isCaseSensitive(int column) throws SQLException  70 { 71 if ((column < 1) || (column > rs.nbOfColumns)) 72 throw new SQLException ("Invalid column index " + column); 73 return rs.fields[column - 1].isCaseSensitive(); 74 } 75 76 79 public boolean isSearchable(int column) throws SQLException  80 { 81 if ((column < 1) || (column > rs.nbOfColumns)) 82 throw new SQLException ("Invalid column index " + column); 83 return rs.fields[column - 1].isSearchable(); 84 } 85 86 89 public boolean isCurrency(int column) throws SQLException  90 { 91 if ((column < 1) || (column > rs.nbOfColumns)) 92 throw new SQLException ("Invalid column index " + column); 93 return rs.fields[column - 1].isCurrency(); 94 } 95 96 99 public int isNullable(int column) throws SQLException  100 { 101 if ((column < 1) || (column > rs.nbOfColumns)) 102 throw new SQLException ("Invalid column index " + column); 103 return rs.fields[column - 1].isNullable(); 104 } 105 106 109 public boolean isSigned(int column) throws SQLException  110 { 111 if ((column < 1) || (column > rs.nbOfColumns)) 112 throw new SQLException ("Invalid column index " + column); 113 return rs.fields[column - 1].isSigned(); 114 } 115 116 119 public int getColumnDisplaySize(int column) throws SQLException  120 { 121 if ((column < 1) || (column > rs.nbOfColumns)) 122 throw new SQLException ("Invalid column index " + column); 123 return rs.fields[column - 1].getColumnDisplaySize(); 124 } 125 126 129 public String getColumnLabel(int column) throws SQLException  130 { 131 if ((column < 1) || (column > rs.nbOfColumns)) 132 throw new SQLException ("Invalid column index " + column); 133 return rs.fields[column - 1].getFieldLabel(); 134 } 135 136 139 public String getColumnName(int column) throws SQLException  140 { 141 if ((column < 1) || (column > rs.nbOfColumns)) 142 throw new SQLException ("Invalid column index " + column); 143 return rs.fields[column - 1].getFieldName(); 144 } 145 146 149 public String getSchemaName(int column) throws SQLException  150 { 151 if ((column < 1) || (column > rs.nbOfColumns)) 152 throw new SQLException ("Invalid column index " + column); 153 return rs.fields[column - 1].getFullName(); 154 } 155 156 159 public int getPrecision(int column) throws SQLException  160 { 161 if ((column < 1) || (column > rs.nbOfColumns)) 162 throw new SQLException ("Invalid column index " + column); 163 return rs.fields[column - 1].getPrecision(); 164 } 165 166 169 public int getScale(int column) throws SQLException  170 { 171 if ((column < 1) || (column > rs.nbOfColumns)) 172 throw new SQLException ("Invalid column index " + column); 173 return rs.fields[column - 1].getScale(); 174 } 175 176 179 public String getTableName(int column) throws SQLException  180 { 181 if ((column < 1) || (column > rs.nbOfColumns)) 182 throw new SQLException ("Invalid column index " + column); 183 return rs.fields[column - 1].getTableName(); 184 } 185 186 189 public String getCatalogName(int column) throws SQLException  190 { 191 if ((column < 1) || (column > rs.nbOfColumns)) 192 throw new SQLException ("Invalid column index " + column); 193 return ""; 194 } 195 196 199 public int getColumnType(int column) throws SQLException  200 { 201 if ((column < 1) || (column > rs.nbOfColumns)) 202 throw new SQLException ("Invalid column index " + column); 203 return rs.fields[column - 1].getSqlType(); 204 } 205 206 209 public String getColumnTypeName(int column) throws SQLException  210 { 211 if ((column < 1) || (column > rs.nbOfColumns)) 212 throw new SQLException ("Invalid column index " + column); 213 return rs.fields[column - 1].getTypeName(); 214 } 215 216 219 public boolean isReadOnly(int column) throws SQLException  220 { 221 if ((column < 1) || (column > rs.nbOfColumns)) 222 throw new SQLException ("Invalid column index " + column); 223 return rs.fields[column - 1].isReadOnly(); 224 } 225 226 229 public boolean isWritable(int column) throws SQLException  230 { 231 if ((column < 1) || (column > rs.nbOfColumns)) 232 throw new SQLException ("Invalid column index " + column); 233 return rs.fields[column - 1].isWritable(); 234 } 235 236 239 public boolean isDefinitelyWritable(int column) throws SQLException  240 { 241 if ((column < 1) || (column > rs.nbOfColumns)) 242 throw new SQLException ("Invalid column index " + column); 243 return rs.fields[column - 1].isDefinitelyWritable(); 244 } 245 246 249 public String getColumnClassName(int column) throws SQLException  250 { 251 if ((column < 1) || (column > rs.nbOfColumns)) 252 throw new SQLException ("Invalid column index " + column); 253 return rs.fields[column - 1].getColumnClassName(); 254 } 255 256 } 257 | Popular Tags |