db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Davis <da...@guydavis.ca>
Subject Re: Oracle 9i generating empty schema file for DatabaseToDdlTask
Date Mon, 06 Feb 2006 22:11:17 GMT
Thanks for the tips Tom.  Unfortunately, I'm still getting an empty 
schema.xml file when using the Ant task.  Here's my Ant task now:

	<target name="db.clean" description="Reset the configured database to 
base install.">
		<taskdef name="db_to_ddl" classpath="../ddlutils/target/classes" 
				<path refid="build.app.classpath" />
				<pathelement location="../ddlutils/target/classes" />
					<fileset dir="../ddlutils/lib">
						<include name="**/*.jar" />
						<include name="**/*.zip" />

		<db_to_ddl schema="DV_MASTER" databaseType="Oracle9">
			<database url="jdbc:oracle:thin:@//INTDB002:1521/INTDEV01"
				username="DV_MASTER" password="password" />
			<writeSchemaToFile outputFile="schema.xml" />

I also wrote a short JUnit test that does a similar thing, but this one 
works.  I get the DDL written to the file in schema.xml.  I can't figure 
out what the difference is:

public Database readDatabase(DataSource dataSource)
			throws DynaSqlException, SQLException {
		Platform platform = PlatformFactory
		return platform.readModelFromDatabase(dataSource.getConnection(), null,
				null, "DV_MASTER", null);

	public void testWriteDb() throws Exception {
		OracleDataSource dataSource = new OracleDataSource();

		Database db = readDatabase(dataSource);
		new DatabaseIO().write(db, new FileWriter(new File("schema.xml")));

DDLUtils integration with Ant is what made me give it a try.  I'd really 
like to know what I'm doing wrong with the Ant task...


Thomas Dudziak wrote:
> On 2/4/06, Guy Davis <davis@guydavis.ca> wrote:
>>I'm trying to generate a DDL XML file from our current database.  Here's
>>my target from build.xml.  The target runs with no errors but the output
>>file is empty.  Any ideas?
> At first glance, this seems to a problem with rights. You should check
> that you have the necessary rights to *see* the tables in the schema
> With Oracle, it is also helpful to explicitly specify the platform to
> use because there are three different ones (8, 9, 10 with 8 the
> default) that differ. I.e. for an Oracle9 database:
> <db_to_ddl schema="DV_MASTER" databaseType="Oracle9">
> It might also be helpful to run Ant with the -v or the -debug switches
> in order to get more info about the Ant run.
> Tom

View raw message