You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Thorbjørn Ravn Andersen <th...@gmail.com> on 2005/11/04 13:25:32 UTC
DatabaseIO().write(database, file) does not write index information
I wish to use ddlutils to compare two schemas to see if they are
identical, and if not, where. I am starting with Oracle but will
include DB2 plus some java based database for testing very soon.
I have the following snippet:
private static Database getDatabase(String schema, String url,
String username, String password, String name, Properties p)
throws SQLException {
Connection jdbcConnection = DriverManager.getConnection(url,
username,
password);
JdbcModelReader r = new JdbcModelReader();
String thiscatalog = null;
String thisschema = schema;
Database d = r.getDatabase(jdbcConnection, thiscatalog, thisschema,
new String[] {});
Table[] t = d.getTables();
System.out.println(Arrays.asList(t));
return d;
}
which I call like this:
d = getDatabase(schema, url, username, password, name, p);
new DatabaseIO().write(d, "vmtra03-axs.xml");
which returns the tables I expect (after upgrading to the 10g JDBC
driver). It does not, however, return index information on the tables,
which is needed too. I looked in the code, and saw that apparently this
requires additional invocations to get loaded, but wanted to ask on the
status on the list first.
I also expect to have to deal with sequences, but have not gotten that
far yet.
Could a knowledgeable person let me know how to include index
information to what I have?
Best Regards,
--
Thorbjørn
Re: DatabaseIO().write(database, file) does not write index information
Posted by Thomas Dudziak <to...@gmail.com>.
On 11/4/05, Thorbjørn Ravn Andersen <th...@gmail.com> wrote:
> I wish to use ddlutils to compare two schemas to see if they are
> identical, and if not, where. I am starting with Oracle but will
> include DB2 plus some java based database for testing very soon.
<snip>
> It does not, however, return index information on the tables,
> which is needed too. I looked in the code, and saw that apparently this
> requires additional invocations to get loaded, but wanted to ask on the
> status on the list first.
Unfortunately, the database -> model part is not complete yet. But you
add an issue to JIRA stating that index reading does not work with
Oracle.
> I also expect to have to deal with sequences, but have not gotten that
> far yet.
I think this doing this in a generic way is only possible for a very
limited set of sequences (namely auto-increment sequences).
Tom