1 24 25 package org.objectweb.cjdbc.driver; 26 27 import java.sql.SQLException ; 28 29 36 public class ResultSetMetaData implements java.sql.ResultSetMetaData 37 { 38 private DriverResultSet rs; 39 40 45 public ResultSetMetaData(DriverResultSet rs) 46 { 47 this.rs = rs; 48 } 49 50 53 public int getColumnCount() throws SQLException 54 { 55 return rs.nbOfColumns; 56 } 57 58 61 public boolean isAutoIncrement(int column) throws SQLException 62 { 63 if ((column < 1) || (column > rs.nbOfColumns)) 64 throw new SQLException ("Invalid column index " + column); 65 return rs.fields[column - 1].isAutoIncrement(); 66 } 67 68 71 public boolean isCaseSensitive(int column) throws SQLException 72 { 73 if ((column < 1) || (column > rs.nbOfColumns)) 74 throw new SQLException ("Invalid column index " + column); 75 return rs.fields[column - 1].isCaseSensitive(); 76 } 77 78 81 public boolean isSearchable(int column) throws SQLException 82 { 83 if ((column < 1) || (column > rs.nbOfColumns)) 84 throw new SQLException ("Invalid column index " + column); 85 return rs.fields[column - 1].isSearchable(); 86 } 87 88 91 public boolean isCurrency(int column) throws SQLException 92 { 93 if ((column < 1) || (column > rs.nbOfColumns)) 94 throw new SQLException ("Invalid column index " + column); 95 return rs.fields[column - 1].isCurrency(); 96 } 97 98 101 public int isNullable(int column) throws SQLException 102 { 103 if ((column < 1) || (column > rs.nbOfColumns)) 104 throw new SQLException ("Invalid column index " + column); 105 return rs.fields[column - 1].isNullable(); 106 } 107 108 111 public boolean isSigned(int column) throws SQLException 112 { 113 if ((column < 1) || (column > rs.nbOfColumns)) 114 throw new SQLException ("Invalid column index " + column); 115 return rs.fields[column - 1].isSigned(); 116 } 117 118 121 public int getColumnDisplaySize(int column) throws SQLException 122 { 123 if ((column < 1) || (column > rs.nbOfColumns)) 124 throw new SQLException ("Invalid column index " + column); 125 return rs.fields[column - 1].getColumnDisplaySize(); 126 } 127 128 131 public String getColumnLabel(int column) throws SQLException 132 { 133 if ((column < 1) || (column > rs.nbOfColumns)) 134 throw new SQLException ("Invalid column index " + column); 135 return rs.fields[column - 1].getFieldName(); 136 } 137 138 141 public String getColumnName(int column) throws SQLException 142 { 143 if ((column < 1) || (column > rs.nbOfColumns)) 144 throw new SQLException ("Invalid column index " + column); 145 return rs.fields[column - 1].getFieldName(); 146 } 147 148 151 public String getSchemaName(int column) throws SQLException 152 { 153 if ((column < 1) || (column > rs.nbOfColumns)) 154 throw new SQLException ("Invalid column index " + column); 155 return rs.fields[column - 1].getFullName(); 156 } 157 158 161 public int getPrecision(int column) throws SQLException 162 { 163 if ((column < 1) || (column > rs.nbOfColumns)) 164 throw new SQLException ("Invalid column index " + column); 165 return rs.fields[column - 1].getPrecision(); 166 } 167 168 171 public int getScale(int column) throws SQLException 172 { 173 if ((column < 1) || (column > rs.nbOfColumns)) 174 throw new SQLException ("Invalid column index " + column); 175 return rs.fields[column - 1].getScale(); 176 } 177 178 181 public String getTableName(int column) throws SQLException 182 { 183 if ((column < 1) || (column > rs.nbOfColumns)) 184 throw new SQLException ("Invalid column index " + column); 185 return rs.fields[column - 1].getTableName(); 186 } 187 188 191 public String getCatalogName(int column) throws SQLException 192 { 193 if ((column < 1) || (column > rs.nbOfColumns)) 194 throw new SQLException ("Invalid column index " + column); 195 return ""; 196 } 197 198 201 public int getColumnType(int column) throws SQLException 202 { 203 if ((column < 1) || (column > rs.nbOfColumns)) 204 throw new SQLException ("Invalid column index " + column); 205 return rs.fields[column - 1].getSqlType(); 206 } 207 208 211 public String getColumnTypeName(int column) throws SQLException 212 { 213 if ((column < 1) || (column > rs.nbOfColumns)) 214 throw new SQLException ("Invalid column index " + column); 215 return rs.fields[column - 1].getTypeName(); 216 } 217 218 221 public boolean isReadOnly(int column) throws SQLException 222 { 223 if ((column < 1) || (column > rs.nbOfColumns)) 224 throw new SQLException ("Invalid column index " + column); 225 return rs.fields[column - 1].isReadOnly(); 226 } 227 228 231 public boolean isWritable(int column) throws SQLException 232 { 233 if ((column < 1) || (column > rs.nbOfColumns)) 234 throw new SQLException ("Invalid column index " + column); 235 return rs.fields[column - 1].isWritable(); 236 } 237 238 241 public boolean isDefinitelyWritable(int column) throws SQLException 242 { 243 if ((column < 1) || (column > rs.nbOfColumns)) 244 throw new SQLException ("Invalid column index " + column); 245 return rs.fields[column - 1].isDefinitelyWritable(); 246 } 247 248 251 public String getColumnClassName(int column) throws SQLException 252 { 253 if ((column < 1) || (column > rs.nbOfColumns)) 254 throw new SQLException ("Invalid column index " + column); 255 return rs.fields[column - 1].getColumnClassName(); 256 } 257 258 } 259 | Popular Tags |