Tuscany DAS Tools
Building DAS Tools
DBToXSDGenerator provides utility methods for use when DB Schema is available and SDO Model xsds are not. This
utility will help build SDO Model xsds based on DB Schema. These xsds can be supplied to Data Access Service
like (RDB-DAS) to have SDO <-> DB data exchange.
- getModelFileFromDB(String dbInfoFile) - connect to database and convert DB Schema to XSD Model XSDs
- getModelFileFromSchemaFile(String schemaFileName, String SDOModelFileName) - no DB Connection needed, but need Apache Torque output of DB schema file
- getSchemaFileFromDB(String dbInfoFile) - connect to database and use Apache Torque to get DB Schema xml file
- getModelFileFromDB(ModelXSDGenOption mo) - connect to database and convert DB Schema to XSD Model XSDs
- getModelFileFromSchemaFile(ModelXSDGenOption mo) - no DB Connection needed, but need Apache Torque output of DB schema file
- ModelXSDGenOption holds - schemaFile, modelFile, driverClass, databaseURL, schemaName, userName, password
To build the Tuscany DAS DBToXSDGenerator tool, perform the following steps
- Ensure that the environment variable JAVA_HOME is set to point to an installation of Java 1.4 JDK
- --->To run as a maven plugin, run the command "mvn"
- --->To run as a standalone tool, call the above listed methods from DBToXSDGenerator
Assumption Database exists and contains required tables, constraints. Required Driver jar is in classpath
Example dbInfoFile
<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
<!--Uncomment below for derby test-->
<ConnectionInfo>
<ConnectionProperties
driverClass="org.apache.derby.jdbc.EmbeddedDriver"
databaseURL="jdbc:derby:target/dastest"
schemaName = "APP"
loginTimeout="600000"/>
</ConnectionInfo>
<OutFiles
schemaFile="target/dbSchema.txt"
modelFile="target/schemaModel.xsd"
/>
</Config>