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 69846
Collapse All | Expand All

(-)db.metadata.model/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.db.metadata.model/1
2
OpenIDE-Module: org.netbeans.modules.db.metadata.model/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/metadata/model/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/metadata/model/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.1
4
OpenIDE-Module-Specification-Version: 1.2
5
AutoUpdate-Show-In-Client: false
5
AutoUpdate-Show-In-Client: false
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/api/Value.java (+9 lines)
Lines 128-133 Link Here
128
        return impl.getNullable();
128
        return impl.getNullable();
129
    }
129
    }
130
130
131
    /**
132
     * Return database specific name of data type
133
     * 
134
     * @return 
135
     */
136
    public String getTypeName() {
137
        return impl.getTypeName();
138
    }
139
131
    @Override
140
    @Override
132
    public String toString() {
141
    public String toString() {
133
        return impl.toString();
142
        return impl.toString();
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCColumn.java (+5 lines)
Lines 97-102 Link Here
97
    }
97
    }
98
98
99
    @Override
99
    @Override
100
    public String getTypeName() {
101
        return value.getTypeName();
102
    }
103
    
104
    @Override
100
    public int getLength() {
105
    public int getLength() {
101
        return value.getLength();
106
        return value.getLength();
102
    }
107
    }
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCParameter.java (+5 lines)
Lines 109-114 Link Here
109
    }
109
    }
110
110
111
    @Override
111
    @Override
112
    public String getTypeName() {
113
        return value.getTypeName();
114
    }
115
116
    @Override
112
    public int getLength() {
117
    public int getLength() {
113
        return value.getLength();
118
        return value.getLength();
114
    }
119
    }
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/JDBCValue.java (-4 / +16 lines)
Lines 63-68 Link Here
63
    private final MetadataElement parent;
63
    private final MetadataElement parent;
64
    private final String name;
64
    private final String name;
65
    private final SQLType type;
65
    private final SQLType type;
66
    private final String typeName;
66
    private final int length;
67
    private final int length;
67
    private final int precision;
68
    private final int precision;
68
    private final short radix;
69
    private final short radix;
Lines 79-91 Link Here
79
    public static JDBCValue createProcedureValue(ResultSet rs, MetadataElement parent) throws SQLException {
80
    public static JDBCValue createProcedureValue(ResultSet rs, MetadataElement parent) throws SQLException {
80
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
81
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
81
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
82
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
83
        String typeName = rs.getString("TYPE_NAME");
82
        int length = rs.getInt("LENGTH");
84
        int length = rs.getInt("LENGTH");
83
        int precision = rs.getInt("PRECISION");
85
        int precision = rs.getInt("PRECISION");
84
        short scale = rs.getShort("SCALE");
86
        short scale = rs.getShort("SCALE");
85
        short radix = rs.getShort("RADIX");
87
        short radix = rs.getShort("RADIX");
86
        Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE"));
88
        Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE"));
87
89
88
        return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable);
90
        return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable);
89
    }
91
    }
90
92
91
    /**
93
    /**
Lines 111-116 Link Here
111
    public static JDBCValue createTableColumnValue(ResultSet rs, MetadataElement parent) throws SQLException {
113
    public static JDBCValue createTableColumnValue(ResultSet rs, MetadataElement parent) throws SQLException {
112
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
114
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
113
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
115
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
116
        String typeName = rs.getString("TYPE_NAME");
114
117
115
        int length = 0;
118
        int length = 0;
116
        int precision = 0;
119
        int precision = 0;
Lines 126-132 Link Here
126
        short radix = rs.getShort("NUM_PREC_RADIX");
129
        short radix = rs.getShort("NUM_PREC_RADIX");
127
        Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE"));
130
        Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE"));
128
131
129
        return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable);
132
        return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable);
130
    }
133
    }
131
134
132
    /**
135
    /**
Lines 140-145 Link Here
140
    public static JDBCValue createTableColumnValueODBC(ResultSet rs, MetadataElement parent) throws SQLException {
143
    public static JDBCValue createTableColumnValueODBC(ResultSet rs, MetadataElement parent) throws SQLException {
141
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
144
        String name = MetadataUtilities.trimmed(rs.getString("COLUMN_NAME"));
142
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
145
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
146
        String typeName = rs.getString("TYPE_NAME");
143
        int length = 0;
147
        int length = 0;
144
        int precision = 0;
148
        int precision = 0;
145
        if (JDBCUtils.isCharType(type)) {
149
        if (JDBCUtils.isCharType(type)) {
Lines 151-160 Link Here
151
        short radix = rs.getShort("RADIX");
155
        short radix = rs.getShort("RADIX");
152
        Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE"));
156
        Nullable nullable = JDBCUtils.getColumnNullable(rs.getShort("NULLABLE"));
153
157
154
        return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable);
158
        return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable);
155
    }
159
    }
156
160
157
    public JDBCValue(MetadataElement parent, String name, SQLType type, int length, int precision, short radix, short scale, Nullable nullable) {
161
    public JDBCValue(MetadataElement parent, String name, SQLType type,
162
                     String typeName, int length, int precision, short radix, 
163
                     short scale, Nullable nullable) {
158
        this.parent = parent;
164
        this.parent = parent;
159
        this.name = name;
165
        this.name = name;
160
        this.type = type;
166
        this.type = type;
Lines 163-168 Link Here
163
        this.radix = radix;
169
        this.radix = radix;
164
        this.scale = scale;
170
        this.scale = scale;
165
        this.nullable = nullable;
171
        this.nullable = nullable;
172
        this.typeName = typeName;
166
    }
173
    }
167
174
168
    @Override
175
    @Override
Lines 201-206 Link Here
201
    }
208
    }
202
209
203
    @Override
210
    @Override
211
    public String getTypeName() {
212
        return typeName;
213
    }
214
215
    @Override
204
    public String toString() {
216
    public String toString() {
205
        return "name=" + name + ", type=" + type + ", length=" + getLength() + ", precision=" + getPrecision() +
217
        return "name=" + name + ", type=" + type + ", length=" + getLength() + ", precision=" + getPrecision() +
206
                ", radix=" + getRadix() + ", scale=" + getScale() + ", nullable=" + nullable;
218
                ", radix=" + getRadix() + ", scale=" + getScale() + ", nullable=" + nullable;
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/jdbc/mysql/MySQLProcedure.java (-1 / +2 lines)
Lines 93-98 Link Here
93
        int precision = 0;
93
        int precision = 0;
94
94
95
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
95
        SQLType type = JDBCUtils.getSQLType(rs.getInt("DATA_TYPE"));
96
        String typeName = rs.getString("TYPE_NAME");
96
        if (JDBCUtils.isNumericType(type)) {
97
        if (JDBCUtils.isNumericType(type)) {
97
            precision = rs.getInt("PRECISION");
98
            precision = rs.getInt("PRECISION");
98
        } else {
99
        } else {
Lines 102-108 Link Here
102
        short radix = rs.getShort("RADIX");
103
        short radix = rs.getShort("RADIX");
103
        Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE"));
104
        Nullable nullable = JDBCUtils.getProcedureNullable(rs.getShort("NULLABLE"));
104
105
105
        return new JDBCValue(parent, name, type, length, precision, radix, scale, nullable);
106
        return new JDBCValue(parent, name, type, typeName, length, precision, radix, scale, nullable);
106
    }
107
    }
107
108
108
109
(-)db.metadata.model/src/org/netbeans/modules/db/metadata/model/spi/ValueImplementation.java (+8 lines)
Lines 78-81 Link Here
78
78
79
    public abstract SQLType getType();
79
    public abstract SQLType getType();
80
80
81
    /**
82
     * This should be override by the implementation - this is a fallback!
83
     * 
84
     * @return Database specific type name 
85
     */
86
    public String getTypeName() {
87
        return getType().toString();
81
}
88
}
89
}

Return to bug 69846