Loading ...
Sorry, an error occurred while loading the content.

Can you help me Ron?

Expand Messages
  • ask me
    I needed to transfer the datas in the XML file into Oracle8i, and by seraching internet i came across the very helpful site http://www.rpbourret.com
    Message 1 of 2 , Mar 20, 2007
    • 0 Attachment
      I needed to transfer the datas in the XML file into Oracle8i, and by
      seraching internet i came across the very helpful site
      http://www.rpbourret.com <http://www.rpbourret.com> . I downloaded the
      xml-dbms version 2.0

      Although being new to java , i gone through the readme file and had all
      the classpath set for xmldbms20.jar and xerces.jar and then compiled the
      .java files one by one ,blindly just compiled all the files

      Didn't find where to mention the "my database_name " and "drivers"
      ,"userid" and "password"

      First of all i started with the samples and am still stuck there...

      I edited the sql script to create the tables...... which is

      CREATE TABLE Customers ( Cus_Number VARCHAR2(10) NOT NULL, Name
      VARCHAR2(80) NOT NULL, Street VARCHAR2(50), City VARCHAR2(50),
      State VARCHAR2(20), PostalCode VARCHAR2(10), CONSTRAINT PrimaryKey
      PRIMARY KEY ( Cus_Number ))
      /
      CREATE TABLE Parts (
      part_Number VARCHAR2(10) NOT NULL,
      Description VARCHAR2(255),
      Price number(10) NOT NULL, CONSTRAINT PrimaryKey_parts PRIMARY KEY (
      part_Number ))
      /
      CREATE TABLE Orders (
      Order_Number VARCHAR(10) NOT NULL,
      CustNumber VARCHAR(10) NOT NULL,
      order_Date DATE,
      CONSTRAINT PrimaryKey_order PRIMARY KEY ( order_Number ),
      CONSTRAINT FK_Customers_orders FOREIGN KEY ( CustNumber ) REFERENCES
      Customers ( cus_Number ))
      /

      CREATE TABLE Items (
      SO_Number VARCHAR2(10) NOT NULL,
      item_Number number(10) NOT NULL,
      Part VARCHAR2(10) NOT NULL,
      Quantity number(4) NOT NULL,
      CONSTRAINT PrimaryKey_items PRIMARY KEY ( SO_Number , item_Number ),
      CONSTRAINT FK_SalesOrder FOREIGN KEY ( SO_Number ) REFERENCES Orders (
      Order_Number ),
      CONSTRAINT FK_Parts FOREIGN KEY ( Part ) REFERENCES Parts (
      part_Number ))
      /


      Edited the orders.map as .....

      <?XML VERSION='1.0' ?>

      <!--

      THIS SAMPLE IS ROUGHLY EQUIVALENT TO THE VERSION 1.0 SAMPLE

      SALES.MAP. THE ONLY REAL DIFFERENCES ARE A FEW NAME CHANGES.

      -->

      <!DOCTYPE XMLTODBMS SYSTEM "XMLDBMS2.DTD" >

      <XMLTODBMS VERSION="2.0"
      XMLNS="HTTP://WWW.XMLMIDDLEWARE.ORG/XMLDBMS/V2">

      <OPTIONS>

      <SIMPLEDATEFORMAT PATTERN="MM.DD.YY" DEFAULTFORTYPES="DATE" />

      </OPTIONS>

      <DATABASES>

      <DATABASE NAME="BDF01">

      <CATALOG>

      <SCHEMA>

      <TABLE NAME="CUSTOMERS">

      <COLUMN NAME="STREET" DATATYPE="VARCHAR2" LENGTH="50" NULLABLE="NO"/>

      <COLUMN NAME="NAME" DATATYPE="VARCHAR2" LENGTH="80" NULLABLE="NO"/>

      <COLUMN NAME="NUMBER" DATATYPE="VARCHAR2" LENGTH="10" NULLABLE="NO" />

      <COLUMN NAME="CITY" DATATYPE="VARCHAR2" LENGTH="50" NULLABLE="NO"/>

      <COLUMN NAME="POSTALCODE" DATATYPE="VARCHAR2" LENGTH="10"
      NULLABLE="YES"/>

      <COLUMN NAME="STATE" DATATYPE="VRCHAR2" LENGTH="2" NULLABLE="NO"/>

      <PRIMARYKEY KEYGENERATOR="DATABASE">

      <USECOLUMN NAME="CUS_NUMBER"/>

      </PRIMARYKEY>

      </TABLE>

      <TABLE NAME="ITEMS">

      <COLUMN NAME="PART" DATATYPE="VARCHAR2" LENGTH="10" NULLABLE="NO"/>

      <COLUMN NAME="ITEM_NUMBER" DATATYPE="NUMBER" LENGTH="4" NULLABLE="NO"/>

      <COLUMN NAME="QUANTITY" DATATYPE="NUMBER" LENGTH="4" NULLABLE="NO"/>

      <COLUMN NAME="SO_NUMBER" DATATYPE="VARCHAR2" LENGTH="10" NULLABLE="NO"/>

      <PRIMARYKEY>

      <USECOLUMN NAME="SO_NUMBER"/>

      <USECOLUMN NAME="ITEM_NUMBER"/>

      </PRIMARYKEY>

      <FOREIGNKEY NAME="PART_FK">

      <USETABLE NAME="PARTS" />

      <USEUNIQUEKEY NAME="PRIMARYKEY" />

      <USECOLUMN NAME="PART_NUMBER"/>

      </FOREIGNKEY>

      <FOREIGNKEY NAME="SO_FK">

      <USETABLE NAME="ORDERS" />

      <USEUNIQUEKEY NAME="PRIMARYKEY" />

      <USECOLUMN NAME="SO_NUMBER"/>

      </FOREIGNKEY>

      </TABLE>

      <TABLE NAME="ORDERS">

      <COLUMN NAME="CUSTNUMBER" DATATYPE="VARCHAR2" LENGTH="10"
      NULLABLE="NO"/>

      <COLUMN NAME="ORDER_NUMBER" DATATYPE="VARCHAR2" LENGTH="10"
      NULLABLE="NO"/>

      <COLUMN NAME="ORDER_DATE" DATATYPE="DATE" NULLABLE="YES"/>

      <PRIMARYKEY>

      <USECOLUMN NAME="ORDER_NUMBER"/>

      </PRIMARYKEY>

      <FOREIGNKEY NAME="CUST_FK">

      <USETABLE NAME="CUSTOMERS" />

      <USEUNIQUEKEY NAME="PRIMARYKEY" />

      <USECOLUMN NAME="CUSTNUMBER"/>

      </FOREIGNKEY>

      </TABLE>

      <TABLE NAME="PARTS">

      <COLUMN NAME="PART_NUMBER" DATATYPE="VARCHAR2" LENGTH="10"
      NULLABLE="NO"/>

      <COLUMN NAME="PRICE" DATATYPE="NUMBER" NULLABLE="NO"/>

      <COLUMN NAME="DESCRIPTION" DATATYPE="VARCHAR2" LENGTH="255"
      NULLABLE="YES"/>

      <PRIMARYKEY>

      <USECOLUMN NAME="PART_NUMBER"/>

      </PRIMARYKEY>

      </TABLE>

      </SCHEMA>

      </CATALOG>

      </DATABASE>

      </DATABASES>

      <MAPS>

      <CLASSMAP>

      <ELEMENTTYPE NAME="ITEM"/>

      <TOCLASSTABLE NAME="ITEMS"/>

      <PROPERTYMAP>

      <ATTRIBUTE NAME="LINENUMBER"/>

      <TOCOLUMN NAME="SO_NUMBER"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="QUANTITY"/>

      <TOCOLUMN NAME="QUANTITY"/>

      </PROPERTYMAP>

      <RELATEDCLASS KEYINPARENTTABLE="FOREIGN">

      <ELEMENTTYPE NAME="PART"/>

      <USEUNIQUEKEY NAME="PRIMARYKEY"/>

      <USEFOREIGNKEY NAME="PART_FK"/>

      </RELATEDCLASS>

      </CLASSMAP>

      <CLASSMAP>

      <ELEMENTTYPE NAME="PART"/>

      <TOCLASSTABLE NAME="PARTS"/>

      <PROPERTYMAP>

      <ATTRIBUTE NAME="PARTNUMBER"/>

      <TOCOLUMN NAME="PART_NUMBER"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="PRICE"/>

      <TOCOLUMN NAME="PRICE"/>

      </PROPERTYMAP>

      <PROPERTYMAP CONTAINSXML="YES">

      <ELEMENTTYPE NAME="DESCRIPTION"/>

      <TOCOLUMN NAME="DESCRIPTION"/>

      </PROPERTYMAP>

      </CLASSMAP>

      <CLASSMAP>

      <ELEMENTTYPE NAME="CUSTOMER"/>

      <TOCLASSTABLE NAME="CUSTOMERS"/>

      <PROPERTYMAP>

      <ATTRIBUTE NAME="CUSTNUMBER"/>

      <TOCOLUMN NAME="CUS_NUMBER"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="STREET"/>

      <TOCOLUMN NAME="STREET"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="CUSTNAME"/>

      <TOCOLUMN NAME="NAME"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="POSTCODE"/>

      <TOCOLUMN NAME="POSTALCODE"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="CITY"/>

      <TOCOLUMN NAME="CITY"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="STATE"/>

      <TOCOLUMN NAME="STATE"/>

      </PROPERTYMAP>

      </CLASSMAP>

      <CLASSMAP>

      <ELEMENTTYPE NAME="SALESORDER"/>

      <TOCLASSTABLE NAME="ORDERS"/>

      <PROPERTYMAP>

      <ATTRIBUTE NAME="SONUMBER"/>

      <TOCOLUMN NAME="ORDER_NUMBER"/>

      </PROPERTYMAP>

      <PROPERTYMAP>

      <ELEMENTTYPE NAME="ORDERDATE"/>

      <TOCOLUMN NAME="ORDER_DATE"/>

      </PROPERTYMAP>

      <RELATEDCLASS KEYINPARENTTABLE="FOREIGN">

      <ELEMENTTYPE NAME="CUSTOMER"/>

      <USEUNIQUEKEY NAME="PRIMARYKEY"/>

      <USEFOREIGNKEY NAME="CUST_FK"/>

      </RELATEDCLASS>

      <RELATEDCLASS KEYINPARENTTABLE="UNIQUE">

      <ELEMENTTYPE NAME="ITEM"/>

      <USEUNIQUEKEY NAME="PRIMARYKEY"/>

      <USEFOREIGNKEY NAME="SO_FK"/>

      <ORDERCOLUMN NAME="NUMBER" DIRECTION="SCENDING" />

      </RELATEDCLASS>

      </CLASSMAP>

      </MAPS>

      </XMLTODBMS>

      And now when i run manage map.props from command promt it gives

      C:\xmldbms20alpha3\samples>manage map.props

      C:\xmldbms20alpha3\samples>echo off

      C:\xmldbms20alpha3\samples>java
      org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props File2=
      db.props File3=map.props
      java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
      not found and no default dr
      iver specified
      at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
      at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
      at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3028)
      at
      sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
      at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:171)
      at
      org.xmlmiddleware.db.JDBC1DataSource.createObject(JDBC1DataSource.java:1\
      00)
      at org.xmlmiddleware.utils.Pool.checkOut(Pool.java:98)
      at
      org.xmlmiddleware.db.ConnectionPool.checkOut(ConnectionPool.java:79)
      at
      org.xmlmiddleware.db.JDBC1DataSource.getConnection(JDBC1DataSource.java:\
      158)
      at
      org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDTD(MapManager.j\
      ava:567)
      at
      org.xmlmiddleware.xmldbms.tools.MapManager.dispatch(MapManager.java:407)
      at
      org.xmlmiddleware.xmldbms.tools.MapManager.main(MapManager.java:348)



      I am feeling like a soldier who has the weapon and the will to fight but
      just don't know how to use the weapon. I know it's dumb but that's what
      i feel like. Will you help me out Ron?

      Regards,

      Saju Sandeep Samuel.





      [Non-text portions of this message have been removed]
    • Ronald Bourret
      Hello, I haven t looked at your map file yet, but do have the following comments: 1) You do not need to compile the .java files. The compiled files are in
      Message 2 of 2 , Mar 22, 2007
      • 0 Attachment
        Hello,

        I haven't looked at your map file yet, but do have the following comments:

        1) You do not need to compile the .java files. The compiled files are in
        xmldbms20.jar.

        2) By default, the samples use the JDBC-ODBC Bridge driver. (This is the
        property Driver=sun.jdbc.odbc.JdbcOdbcDriver in db.props.) You will
        probably want to change this property to the JDBC driver shipped with
        Oracle. You will need to read the documentation for that driver to see
        how to enter the user name and password. For example, the driver might
        prompt you for them. (You can put them in the db.props file, but this is
        not secure.)

        3) You are getting an error because the JDBC-ODBC Bridge requires you to
        set up an ODBC data source. This error will go away when you set the
        driver to the Oracle driver. However, you will need to specify the URL
        for your database. See the Oracle JDBC driver documentation for the
        format of this URL.

        4) You do not need to use MapManager. This is a tool for generating
        maps. Since you already have a map, you should use the Transfer tool
        (run by transfer.bat in the sample directory) to transfer data.

        -- Ron

        ask me wrote:

        > I needed to transfer the datas in the XML file into Oracle8i, and by
        > seraching internet i came across the very helpful site
        > http://www.rpbourret.com <http://www.rpbourret.com> . I downloaded the
        > xml-dbms version 2.0
        >
        > Although being new to java , i gone through the readme file and had all
        > the classpath set for xmldbms20.jar and xerces.jar and then compiled the
        > .java files one by one ,blindly just compiled all the files
        >
        > Didn't find where to mention the "my database_name " and "drivers"
        > ,"userid" and "password"
        >
        > First of all i started with the samples and am still stuck there...
        > And now when i run manage map.props from command promt it gives
        >
        > C:\xmldbms20alpha3\samples>manage map.props
        >
        > C:\xmldbms20alpha3\samples>echo off
        >
        > C:\xmldbms20alpha3\samples>java
        > org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props File2=
        > db.props File3=map.props
        > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
        > not found and no default dr
        > iver specified
        > at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
        > at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
        > at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3028)
        > at
        > sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
        > at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
        > at java.sql.DriverManager.getConnection(DriverManager.java:512)
        > at java.sql.DriverManager.getConnection(DriverManager.java:171)
        > at
        > org.xmlmiddleware.db.JDBC1DataSource.createObject(JDBC1DataSource.java:1\
        > 00)
        > at org.xmlmiddleware.utils.Pool.checkOut(Pool.java:98)
        > at
        > org.xmlmiddleware.db.ConnectionPool.checkOut(ConnectionPool.java:79)
        > at
        > org.xmlmiddleware.db.JDBC1DataSource.getConnection(JDBC1DataSource.java:\
        > 158)
        > at
        > org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDTD(MapManager.j\
        > ava:567)
        > at
        > org.xmlmiddleware.xmldbms.tools.MapManager.dispatch(MapManager.java:407)
        > at
        > org.xmlmiddleware.xmldbms.tools.MapManager.main(MapManager.java:348)
        >
        >
        >
        > I am feeling like a soldier who has the weapon and the will to fight but
        > just don't know how to use the weapon. I know it's dumb but that's what
        > i feel like. Will you help me out Ron?
      Your message has been successfully submitted and would be delivered to recipients shortly.