Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by willianmaja: http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_HOWTO_HelloDASApp The comment on the change is: It's not finished... Later it'll be more a step-by-step with comments ------------------------------------------------------------------------------ - IN Progress + This Tutorial purpose is to provide a simple "how to" and give a step-by-step to build a simple aplication using DAS/SDO features from Tuscany project. Here you'll build our "CompanyWeb Sample Web Application". This sample uses Mysql and Tomcat. + + + A. Initial Setup: + 1- Install Tomcat{latest version} and Mysql{latest version}. + 2- Download dependencies and libraries + 3- create companyweb directory in {Tomcat root}/webapps/. EX: {Tomcat root}/webapps/companyweb + 4- Create the directory {Tomcat root}/webapps/companyweb/WEB-INF/lib and put the libraries in it. Otherwise you can put them in {Tomcat root}/common/lib + 5- The required libraries are: + i) common-{latest version}.jar + ii) ecore-{latest version}.jar + iii) ecore-change-{latest version}.jar + iv) ecore-xmi-{lateste version}.ar + v) log4j-{latest version}.jar + vi) sdo-api-xxx.jar + vii) tuscany-das-rdb-xxx.jar + viii) tuscany-sdo-xxx.jar + ix) xsd-{latest version}.jar + x) mysql-connector-java-{latest version}.jar + + + B. Creating CompanyWeb Database + 1- Run the following commands in the Mysql Command Shell + create database companyweb; // Creates the CompanyWeb database + use companyweb; // Set the shell to work with companyweb database + 2- Create a companydatabase.sql and inser + source {path}/companyweb.sql // Executes the script to create tables, constraints, etc. + + C. Creating XML configuration file + 1- Create the file CompanyConfig.xml in the directory {Tomcat root}/webapps/companyweb/WEB-INF/classes + 2- Edit it and write the following code: + + <?xml version="1.0" encoding="ASCII"?> + <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Command name="all companies" SQL="select * from COMPANY" kind="Select"/> + + <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/> + + <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/> + + <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/> + + + <Table tableName="COMPANY"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Table tableName="DEPARTMENT"> + <Column columnName="ID" primaryKey="true" generated="true"/> + </Table> + + <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/> + </Relationship> + + + </Config> + + 3- Save the file. + D. Creating the class wich manages the DAS/SDO features + 1- Create the file CompanyCLient.java in the directory {Tomcat root}/webapps/companyweb/WEB-INF/classes/org/apache/tuscany/samples/das/companyweb + 2- Write the following code in the file : + --HOW to make the jsp. + http://people.apache.org/~kelvingoodson/das_java/RC4b/ + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
