This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

problem creating tables using ant + ddl utils for oracle  RSS feed

 
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

i want to create a schema from xml using Apach DDLUtils + ant. i followed the tutorial mentioned here but unable to create the schema.

my DbSchema.xml file is like.....



my build.xml file looks like this....


when i run the script i got this error....

db-setup:
[echo] starting database setup.........
[echo] ------------------------------------------
[echo] database type selected is oracle
[echo] database connection url is jdbcracle:thin:@localhost:1521:xe
[echo] username for database is avinash
[echo] password for database is avinash
[echo] driver detected for connection is oracle.jdbc.driver.OracleDriver
[echo] ------------------------------------------
[ddlToDatabase] Read schema file /home/avinash/My Data/Java/WorkSpaces/bikers-coders/swing-varsity/SwingVarsity/Platform/database-setup/DatabaseSchema.xml
[ddlToDatabase] Borrowed connection jdbcracle:thin:@localhost:1521:xe, UserName=AVINASH, Oracle JDBC driver from data source
[ddlToDatabase] Returning connection jdbcracle:thin:@localhost:1521:xe, UserName=AVINASH, Oracle JDBC driver to data source.
[ddlToDatabase] Remaining connections: None


can anyone help me with this. it would be very helpful if anyone give me code to create schema in oracle using DDLUtils + ant.

Regards,
--
Avinash

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried running Ant with the -v option to see if you get more details? Ire there any options to turn on tracing within ddlToDatabase?
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter i have got the stack trace........ i think its related to DDLUtils, may be something wrong with my configuration...... i will try to find the issue..... thanks again......


at org.apache.ddlutils.task.Command.handleException(Command.java:81)
at org.apache.ddlutils.task.WriteSchemaToDatabaseCommand.execute(WriteSchemaToDatabaseCommand.java:135)
at org.apache.ddlutils.task.DatabaseTaskBase.executeCommands(DatabaseTaskBase.java:337)
at org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:365)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:474)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.apache.ddlutils.model.ModelException: Unknown JDBC type code 2009
at org.apache.ddlutils.model.Column.setTypeCode(Column.java:215)
at org.apache.ddlutils.platform.JdbcModelReader.readColumn(JdbcModelReader.java:781)
at org.apache.ddlutils.platform.oracle.Oracle8ModelReader.readColumn(Oracle8ModelReader.java:117)
at org.apache.ddlutils.platform.JdbcModelReader.readColumns(JdbcModelReader.java:755)
at org.apache.ddlutils.platform.JdbcModelReader.readTable(JdbcModelReader.java:565)
at org.apache.ddlutils.platform.oracle.Oracle8ModelReader.readTable(Oracle8ModelReader.java:102)
at org.apache.ddlutils.platform.JdbcModelReader.readTables(JdbcModelReader.java:516)
at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:472)
at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:432)
at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1884)
at org.apache.ddlutils.platform.PlatformImplBase.getAlterTablesSql(PlatformImplBase.java:615)
at org.apache.ddlutils.platform.PlatformImplBase.alterTables(PlatformImplBase.java:604)
at org.apache.ddlutils.platform.PlatformImplBase.alterTables(PlatformImplBase.java:541)
at org.apache.ddlutils.task.WriteSchemaToDatabaseCommand.execute(WriteSchemaToDatabaseCommand.java:118)
... 19 more
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SOLVED!!! i was missing a schemapattern attribute in ddltodatabase task. thank peter.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!