Why would number columns' scale and/or precision differ in JDBC from Oracle 10 to 11? -


For our database development we have a complete schema DDL script in one hand, to install scratch, But sequential "delta" scripts are upgraded (each script is recorded as executed or not in the special database table).

To test it, we have an ant target which installs an older version, upgrades it and compares it to a newly created schema, to compare the schema to JDBC Metadata And it works very well with Oracle 10.

Now we have upgraded to Oracle 11 and have moved from ojdbc14.jar to ojdbc6.jar. The test still runs green on Oracle 10, but we get (two specific examples) on Oracle 11:

  table & lt; Table X & gt; Column & lt; Column A & gt; & Lt; New schema & gt; In the form of no NUMBER (1,0), but as (& 0) advanced schema & gt; Does not have NUMBER (0,0) Table & lt; Table Y & gt; Column & lt; Column B & gt; As (0, -127) as NUMBER & lt; New schema & gt;, but not NUMBER (0,0) as & lt; Upgraded Schema & gt;  

Almost looks (-127 is not a good scale now) Well, if we did something wrong, but a lot of files have been written earlier and here script statement:

DDL script:

  create table & lt; Table X & gt; (... & lt; column B & gt; NUMBER (1) DEFAULT 0 zero, ...) Create a table & lt; Table Y & gt; (... & lt; column B & gt; NUMBER DEFAULT 1 zero, ...)  

Delta script:

  optional table & lt ; Table X & gt; Add (& lt; Column A & gt; NUMBER (1) DEFAULT 0 Faucet) Optional Table & lt; Table Y & gt;  

And here is the JDBC metadata code:

  column of the public class {string name; & Lt; Column B & gt; NUMBER DEFAULT 1 NOT NULL) Int scale; Integer accuracy; Boolean Nalabal; String type; Public column (resulting metadata metadata, at column) throws SQLException {name = metaData.getColumnName (column); Type = metaData.getColumnTypeName (column); Scale = metaData.getScale (column); Exact = metadata.jetpression (column); Totals = Metadata. Successful (column) == ResultantMatDataClallMon; } @ Override public string toasting () {return type + "(" + precise + "," + scale + ")" + (faucetable? "NULL": "NOT NULL"); }}  

Yes, the column starts with index 1 and it is the toting value () which is used to compare different columns (above error is also used in the output is).

I have debug this code and as far as I can see, the Oracle JDBC driver receives these values ​​when "describing" the table to prepare metadata internally.

Note that both schemas are very similar to database examples and JDBC connections created by the same JDBC library. Similar discrepancies arise when using the old ojdbc14.jar, but never in Oracle 10.

Can anyone have this how can it be? I'm stuck and we have been left without a reliable test of our database upgrade script.

Please vote for this to be a bug in the ojdbc driver. He said, I could probably remove DDL I'll call the DBMS_METADATA package. ResultSetMetaData focuses more on determining the types in a result set, as opposed to determining the metadata of database objects themselves.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -