00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.driver;
00026
00027 import java.sql.SQLException;
00028
00029
00030
00031
00032
00033
00034
00035
00036 public class ResultSetMetaData implements java.sql.ResultSetMetaData
00037 {
00038 private DriverResultSet rs;
00039
00040
00041
00042
00043
00044
00045 public ResultSetMetaData(DriverResultSet rs)
00046 {
00047 this.rs = rs;
00048 }
00049
00050
00051
00052
00053 public int getColumnCount() throws SQLException
00054 {
00055 return rs.nbOfColumns;
00056 }
00057
00058
00059
00060
00061 public boolean isAutoIncrement(int column) throws SQLException
00062 {
00063 if ((column < 1) || (column > rs.nbOfColumns))
00064 throw new SQLException("Invalid column index " + column);
00065 return rs.fields[column - 1].isAutoIncrement();
00066 }
00067
00068
00069
00070
00071 public boolean isCaseSensitive(int column) throws SQLException
00072 {
00073 if ((column < 1) || (column > rs.nbOfColumns))
00074 throw new SQLException("Invalid column index " + column);
00075 return rs.fields[column - 1].isCaseSensitive();
00076 }
00077
00078
00079
00080
00081 public boolean isSearchable(int column) throws SQLException
00082 {
00083 if ((column < 1) || (column > rs.nbOfColumns))
00084 throw new SQLException("Invalid column index " + column);
00085 return rs.fields[column - 1].isSearchable();
00086 }
00087
00088
00089
00090
00091 public boolean isCurrency(int column) throws SQLException
00092 {
00093 if ((column < 1) || (column > rs.nbOfColumns))
00094 throw new SQLException("Invalid column index " + column);
00095 return rs.fields[column - 1].isCurrency();
00096 }
00097
00098
00099
00100
00101 public int isNullable(int column) throws SQLException
00102 {
00103 if ((column < 1) || (column > rs.nbOfColumns))
00104 throw new SQLException("Invalid column index " + column);
00105 return rs.fields[column - 1].isNullable();
00106 }
00107
00108
00109
00110
00111 public boolean isSigned(int column) throws SQLException
00112 {
00113 if ((column < 1) || (column > rs.nbOfColumns))
00114 throw new SQLException("Invalid column index " + column);
00115 return rs.fields[column - 1].isSigned();
00116 }
00117
00118
00119
00120
00121 public int getColumnDisplaySize(int column) throws SQLException
00122 {
00123 if ((column < 1) || (column > rs.nbOfColumns))
00124 throw new SQLException("Invalid column index " + column);
00125 return rs.fields[column - 1].getColumnDisplaySize();
00126 }
00127
00128
00129
00130
00131 public String getColumnLabel(int column) throws SQLException
00132 {
00133 if ((column < 1) || (column > rs.nbOfColumns))
00134 throw new SQLException("Invalid column index " + column);
00135 return rs.fields[column - 1].getFieldName();
00136 }
00137
00138
00139
00140
00141 public String getColumnName(int column) throws SQLException
00142 {
00143 if ((column < 1) || (column > rs.nbOfColumns))
00144 throw new SQLException("Invalid column index " + column);
00145 return rs.fields[column - 1].getFieldName();
00146 }
00147
00148
00149
00150
00151 public String getSchemaName(int column) throws SQLException
00152 {
00153 if ((column < 1) || (column > rs.nbOfColumns))
00154 throw new SQLException("Invalid column index " + column);
00155 return rs.fields[column - 1].getFullName();
00156 }
00157
00158
00159
00160
00161 public int getPrecision(int column) throws SQLException
00162 {
00163 if ((column < 1) || (column > rs.nbOfColumns))
00164 throw new SQLException("Invalid column index " + column);
00165 return rs.fields[column - 1].getPrecision();
00166 }
00167
00168
00169
00170
00171 public int getScale(int column) throws SQLException
00172 {
00173 if ((column < 1) || (column > rs.nbOfColumns))
00174 throw new SQLException("Invalid column index " + column);
00175 return rs.fields[column - 1].getScale();
00176 }
00177
00178
00179
00180
00181 public String getTableName(int column) throws SQLException
00182 {
00183 if ((column < 1) || (column > rs.nbOfColumns))
00184 throw new SQLException("Invalid column index " + column);
00185 return rs.fields[column - 1].getTableName();
00186 }
00187
00188
00189
00190
00191 public String getCatalogName(int column) throws SQLException
00192 {
00193 if ((column < 1) || (column > rs.nbOfColumns))
00194 throw new SQLException("Invalid column index " + column);
00195 return "";
00196 }
00197
00198
00199
00200
00201 public int getColumnType(int column) throws SQLException
00202 {
00203 if ((column < 1) || (column > rs.nbOfColumns))
00204 throw new SQLException("Invalid column index " + column);
00205 return rs.fields[column - 1].getSqlType();
00206 }
00207
00208
00209
00210
00211 public String getColumnTypeName(int column) throws SQLException
00212 {
00213 if ((column < 1) || (column > rs.nbOfColumns))
00214 throw new SQLException("Invalid column index " + column);
00215 return rs.fields[column - 1].getTypeName();
00216 }
00217
00218
00219
00220
00221 public boolean isReadOnly(int column) throws SQLException
00222 {
00223 if ((column < 1) || (column > rs.nbOfColumns))
00224 throw new SQLException("Invalid column index " + column);
00225 return rs.fields[column - 1].isReadOnly();
00226 }
00227
00228
00229
00230
00231 public boolean isWritable(int column) throws SQLException
00232 {
00233 if ((column < 1) || (column > rs.nbOfColumns))
00234 throw new SQLException("Invalid column index " + column);
00235 return rs.fields[column - 1].isWritable();
00236 }
00237
00238
00239
00240
00241 public boolean isDefinitelyWritable(int column) throws SQLException
00242 {
00243 if ((column < 1) || (column > rs.nbOfColumns))
00244 throw new SQLException("Invalid column index " + column);
00245 return rs.fields[column - 1].isDefinitelyWritable();
00246 }
00247
00248
00249
00250
00251 public String getColumnClassName(int column) throws SQLException
00252 {
00253 if ((column < 1) || (column > rs.nbOfColumns))
00254 throw new SQLException("Invalid column index " + column);
00255 return rs.fields[column - 1].getColumnClassName();
00256 }
00257
00258 }