1 29 package com.caucho.db.jdbc; 30 31 import com.caucho.db.sql.Expr; 32 import com.caucho.db.sql.SelectResult; 33 34 import java.sql.ResultSetMetaData ; 35 36 39 public class ResultSetMetaDataImpl implements ResultSetMetaData { 40 private final SelectResult _rs; 41 42 ResultSetMetaDataImpl(SelectResult rs) 43 { 44 _rs = rs; 45 } 46 47 50 public int getColumnCount() 51 { 52 return _rs.getExprs().length; 53 } 54 55 58 public boolean isAutoIncrement(int column) 59 { 60 return false; 61 } 62 63 66 public boolean isCaseSensitive(int column) 67 { 68 return true; 69 } 70 71 74 public boolean isSearchable(int column) 75 { 76 return false; 77 } 78 79 82 public boolean isCurrency(int column) 83 { 84 return false; 85 } 86 87 90 public int isNullable(int column) 91 { 92 throw new UnsupportedOperationException (); 93 } 94 95 98 public int getColumnDisplaySize(int column) 99 { 100 return 16; 101 } 102 103 106 public String getColumnLabel(int column) 107 { 108 return getColumnName(column); 109 } 110 111 114 public String getColumnName(int column) 115 { 116 return getColumn(column).getName(); 117 } 118 119 122 public String getColumnSchema(int column) 123 { 124 throw new UnsupportedOperationException (); 125 } 126 127 130 public boolean isSigned(int column) 131 { 132 return true; 133 } 134 135 138 public int getPrecision(int column) 139 { 140 return 0; 141 } 142 143 146 public int getScale(int column) 147 { 148 return 0; 149 } 150 151 154 public String getSchemaName(int column) 155 { 156 return getTableName(column); 157 } 158 159 162 public String getTableName(int column) 163 { 164 return getColumn(column).getTable().getName(); 165 } 166 167 170 public String getCatalogName(int column) 171 { 172 return null; 173 } 174 175 178 public int getColumnType(int column) 179 { 180 return getColumn(column).getSQLType(); 181 } 182 183 186 public String getColumnTypeName(int column) 187 { 188 throw new UnsupportedOperationException (); 189 } 190 191 194 public boolean isReadOnly(int column) 195 { 196 throw new UnsupportedOperationException (); 197 } 198 199 202 public boolean isWritable(int column) 203 { 204 throw new UnsupportedOperationException (); 205 } 206 207 210 public boolean isDefinitelyWritable(int column) 211 { 212 throw new UnsupportedOperationException (); 213 } 214 215 218 public String getColumnClassName(int column) 219 { 220 throw new UnsupportedOperationException (); 221 } 222 223 226 public Expr getColumn(int column) 227 { 228 return _rs.getExprs()[column - 1]; 229 } 230 } 231 | Popular Tags |