1 30 31 32 package org.hsqldb.jdbc; 33 34 import java.lang.reflect.Field ; 35 36 44 public final class jdbcColumnMetaData { 45 46 47 public String catalogName; 48 49 54 public String columnClassName; 55 56 57 public int columnDisplaySize; 58 59 60 public String columnLabel; 61 62 63 public String columnName; 64 65 66 public int columnType; 67 68 69 public String columnTypeName; 70 71 72 public int precision; 73 74 75 public int scale; 76 77 78 public String schemaName; 79 80 81 public String tableName; 82 83 84 public boolean isAutoIncrement; 85 86 87 public boolean isCaseSensitive; 88 89 90 public boolean isCurrency; 91 92 93 public boolean isDefinitelyWritable; 94 95 96 public int isNullable; 97 98 99 public boolean isReadOnly; 100 101 102 public boolean isSearchable; 103 104 105 public boolean isSigned; 106 107 108 public boolean isWritable; 109 110 115 public String toString() { 116 117 try { 118 return toStringImpl(); 119 } catch (Exception e) { 120 return super.toString() + "[" + e + "]"; 121 } 122 } 123 124 129 private String toStringImpl() throws Exception { 130 131 StringBuffer sb; 132 Field [] fields; 133 Field field; 134 135 sb = new StringBuffer (); 136 137 sb.append('['); 138 139 fields = getClass().getFields(); 140 141 int len = fields.length; 142 143 for (int i = 0; i < len; i++) { 144 field = fields[i]; 145 146 sb.append(field.getName()); 147 sb.append('='); 148 sb.append(field.get(this)); 149 150 if (i + 1 < len) { 151 sb.append(','); 152 sb.append(' '); 153 } 154 } 155 156 sb.append(']'); 157 158 return sb.toString(); 159 } 160 } 161 | Popular Tags |