Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 585591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:01:08+00:00 2026-05-13T15:01:08+00:00

For our database development we have on one hand a full schema DDL script,

  • 0

For our database development we have on one hand a full schema DDL script, for scratch installs, and on the other a set of sequential “delta” scripts, for upgrades (each script is recorded as executed or not in a special database table).

To test this we have an ant target that install an older version, upgrades it and compares the schema to a newly created one. We use JDBC MetaData to compare the schemas and with Oracle 10 this worked just great.

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

Table <table X> has column <column A> as NUMBER(1,0) NOT NULL in <new schema>, but as NUMBER(0,0) NOT NULL in <upgraded schema>
Table <table Y> has column <column B> as NUMBER(0,-127) NOT NULL in <new schema>, but as NUMBER(0,0) NOT NULL in <upgraded schema>

Looks almost (-127 is not a nice scale now is it) OK, if we had done something wrong. But the very same files worked before and here are the script statements:

DDL script:

CREATE TABLE <table X> ( 
...
<column B> NUMBER(1) DEFAULT 0 NOT NULL,
...
) 

CREATE TABLE <table Y> ( 
...
<column B> NUMBER DEFAULT 1 NOT NULL,
...
) 

Delta script:

ALTER TABLE <table X> ADD (
<column A> NUMBER(1) DEFAULT 0 NOT NULL
)

ALTER TABLE <table Y> ADD (<column B> NUMBER DEFAULT 1 NOT NULL)

And here is the JDBC MetaData code:

public class Column {

String name;

int scale;

int precision;

boolean nullable;

String type;

public Column(ResultSetMetaData metaData, int column) throws SQLException {
    name = metaData.getColumnName(column);
    type = metaData.getColumnTypeName(column);
    scale = metaData.getScale(column);
    precision = metaData.getPrecision(column);
    nullable = metaData.isNullable(column) == ResultSetMetaData.columnNullable;
}

@Override
public String toString() {
    return type + "(" + precision + "," + scale + ") "
            + (nullable ? "NULL" : "NOT NULL");
}
}

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

I’ve debugged this code and as far as I can see, the Oracle JDBC driver gets these values when internally “describing” the table to produce the MetaData.

Note that both schemas are in the very same database instance and the JDBC connections are both made by the very same JDBC library. The same discrepancies are produced when using the older ojdbc14.jar, but never in Oracle 10.

Does anybody have any input on how this can be? I’m stuck and we’re left without a trustable test of our database upgrade scripts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:01:08+00:00Added an answer on May 13, 2026 at 3:01 pm

    I’d vote for it being a bug in the ojdbc driver. That said, I would probably call the DBMS_METADATA packages for extracting DDL. The ResultSetMetaData seems more focused on determining the types in a result set as opposed to determining the metadata of database objects themselves.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 311k
  • Answers 311k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use an in-line view: select calcdate from (… May 13, 2026 at 10:19 pm
  • Editorial Team
    Editorial Team added an answer What could have happened depends on which version of IIS… May 13, 2026 at 10:19 pm
  • Editorial Team
    Editorial Team added an answer Don't expose the private Collection member of the model, thus… May 13, 2026 at 10:19 pm

Related Questions

I'm part of a software development company where we do custom developed applications for
My DBA just lost some development work that he did on our development database.
We have a production SQL Server 2005 database server with the production version of
First some background information: We have three environments for our EJB3 application: test, development
Where I'm at we have a software package running on a mainframe system. The

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.