This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 193414
Collapse All | Expand All

(-)../../n2/db.dataview/src/org/netbeans/modules/db/dataview/util/DBReadWriteHelper.java (-23 / +18 lines)
Lines 157-186 Link Here
157
                    return bddata;
157
                    return bddata;
158
                }
158
                }
159
            }
159
            }
160
            case Types.INTEGER: {
160
            case Types.INTEGER: 
161
                int idata = rs.getInt(index);
161
            case Types.SMALLINT: 
162
                if (rs.wasNull()) {
163
                    return null;
164
                } else {
165
                    return new Integer(idata);
166
                }
167
            }
168
            case Types.SMALLINT: {
169
                short sidata = rs.getShort(index);
170
                if (rs.wasNull()) {
171
                    return null;
172
                } else {
173
                    return new Short(sidata);
174
                }
175
            }
176
            case Types.TINYINT: {
162
            case Types.TINYINT: {
177
                // byte primitive data type is not enough for UNSIGNED TINYINT
163
		try {
178
                short tidata = rs.getShort(index);
164
			int idata = rs.getInt(index);
179
                if (rs.wasNull()) {
165
			if (rs.wasNull()) {
180
                    return null;
166
			    return null;
181
                } else {
167
			} else {
182
                    return new Short(tidata);
168
			    return new Integer(idata);
183
                }
169
			}
170
		} catch (java.sql.SQLDataException ex) {
171
			long ldata = rs.getLong(index);
172
			if (rs.wasNull()) {
173
			    return null;
174
			} else {
175
			    return new Long(ldata);
176
			}
177
			
178
		}
184
            }
179
            }
185
            // JDBC/ODBC bridge JDK1.4 brings back -9 for nvarchar columns in
180
            // JDBC/ODBC bridge JDK1.4 brings back -9 for nvarchar columns in
186
            // MS SQL Server tables.
181
            // MS SQL Server tables.

Return to bug 193414