1 33 34 35 package com.internetcds.jdbc.tds; 36 37 import java.sql.ResultSetMetaData ; 38 39 40 public class Column 41 { 42 public static final String cvsVersion = "$Id: Column.java,v 1.1 2006/06/23 10:39:04 sinisa Exp $"; 43 44 45 private String name; 46 private boolean haveName = false; 47 private int displaySize; 48 private boolean haveDisplaySize = false; 49 private String label; 50 private boolean haveLabel = false; 51 private int type; 52 private boolean haveType = false; 53 private int precision; 54 private boolean havePrecision = false; 55 private int scale; 56 private boolean haveScale = false; 57 private boolean readOnly = false; 58 private boolean readOnlySet = false; 59 private boolean autoIncrement = false; 60 private boolean autoIncrementSet = false; 61 private int nullable = java.sql.ResultSetMetaData.columnNullableUnknown; 62 63 public Column() 64 { 65 name = null; 66 displaySize = -1; 67 label = null; 68 type = -1; 69 precision = -1; 70 scale = -1; 71 } 72 73 public void setName(String value) 74 { 75 name = value; 76 haveName = true; 77 } 78 79 public String getName() 80 { 81 return name; 82 } 83 84 public void setDisplaySize(int value) 85 { 86 displaySize = value; 87 haveDisplaySize = true; 88 } 89 90 public int getDisplaySize() 91 { 92 return displaySize; 93 } 94 95 public void setLabel(String value) 96 { 97 label = value; 98 haveLabel = true; 99 } 100 101 public String getLabel() 102 { 103 return label; 104 } 105 106 public void setType(int value) 107 { 108 type = value; 110 haveType = true; 111 } 112 113 public int getType() 114 { 115 return type; 116 } 117 118 public void setPrecision(int value) 119 { 120 precision = value; 121 havePrecision = true; 122 } 123 124 public int getPrecision() 125 { 126 return precision; 127 } 128 129 public void setScale(int value) 130 { 131 scale = value; 132 haveScale = true; 133 } 134 135 public int getScale() 136 { 137 return scale; 138 } 139 140 public boolean isAutoIncrement () 141 { 142 return autoIncrement; 143 } 144 145 public void setAutoIncrement (boolean flag) 146 { 147 autoIncrementSet = true; 148 autoIncrement = flag; 149 } 150 151 public boolean autoIncrementWasSet() 152 { 153 return autoIncrementSet; 154 } 155 156 157 public int isNullable () 158 { 159 return nullable; 160 } 161 162 public void setNullable (int flag) 163 { 164 nullable = flag; 165 } 166 167 public boolean isReadOnly () 168 { 169 return readOnly; 170 } 171 172 public void setReadOnly (boolean flag) 173 { 174 readOnlySet = true; 175 readOnly = flag; 176 } 177 178 public boolean readOnlyWasSet() 179 { 180 return readOnlySet; 181 } 182 } 183 | Popular Tags |