To evaluate the tool, I've loaded it up with a set of tables (a sample set from JavaBlend, so I could
compare the results). For certain of these tables, when I highlight the table in the "Workbench" submenu
and click the "Fields" tab in the "Table Definition" menu, the tab does not display and I get an exception.
This seems to correlate with tables that have string columns (VARCHAR).
The first few lines of the extensive exception stack are below
Exception occurred during event dispatching:
java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at java.lang.IllegalArgumentException.<init>(Compiled Code)
at java.text.NumberFormat.format(Compiled Code)
at java.text.Format.format(Compiled Code)
at javax.swing.JTable$7.setValue(Compiled Code)
at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(Compiled Code)
at javax.swing.JTable.prepareRenderer(Compiled Code)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Compiled Code)
at javax.swing.plaf.basic.BasicTableUI.paintRow(Compiled Code)
at javax.swing.plaf.basic.BasicTableUI.paint(Compiled Code)
It looks like some object is being inserted into a JTable column which should have a numeric value but doesn't.
(presumably, then, the bad value is going into the "Length" or "Scale" column.)
Here's the tool-generated SQL that defines one of the tables that causes the exception:
DROP TABLE PROCESSOR
go
CREATE TABLE PROCESSOR
(
ID NUMBER(20, 0) NOT NULL,
PROCTYPE VARCHAR2(30) NULL,
CLOCKSPEED VARCHAR2(30) NULL,
constraint PROCESSOR_keys0 primary key (ID)
)
go
Here's the tool-generated SQL that defines a table that does NOT Fail:
DROP TABLE PART
go
CREATE TABLE PART
(
ID NUMBER(20, 0) NOT NULL,
UNITPRICE NUMBER(7, 2) NULL,
QUANTITY NUMBER(20, 0) NULL,
constraint PART_keys0 primary key (ID)
)
go
As I look over the nine tables in this set, it looks like the problem coincides precisely with those 6 of
them that have columns of type VARCHAR.
Platform info:
JDK 1.1.2, from Sun
Solaris 2.7 on Sparc
Logged In: YES
user_id=7059
I too am having problems with assigning lengths in certain
fields when creating a table. It appears that for VARCHAR
and NUMBER entering a length value results in exception
being generated. It also appears as if there is a roll-off
effect to the scale field.