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

statement closed

Expand Messages
  • elsa_jin
    Hi all, I just tried xmldbms days ago. What I m trying to do is transfering data from MS Access to MySQL database. I used MapManager tool to generate a DTD
    Message 1 of 6 , Nov 11, 2005
    • 0 Attachment
      Hi all,

      I just tried xmldbms days ago. What I'm trying to do is transfering
      data from MS Access to MySQL database. I used MapManager tool to
      generate a DTD file and a Map file from the database. It worked.
      However, when I use transfer tool to transfer data, I got:
      java.sql.SQLException: [XML-DBMS][SPPreparedStatement] Statement closed.
      at
      org.xmlmiddleware.db.SPPreparedStatement.checkState(SPPreparedStatement.java:833)
      at
      org.xmlmiddleware.db.SPPreparedStatement.setAsciiStream(SPPreparedStatement.java:313)
      at
      org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameter(Parameters.java:181)
      at
      org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameters(Parameters.java:89)
      at
      org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.makeInsert(DataHandlerBase.java:378)
      at
      org.xmlmiddleware.xmldbms.datahandlers.GenericHandler.insert(GenericHandler.java:49)
      at
      org.xmlmiddleware.xmldbms.DOMToDBMS.storeRow(DOMToDBMS.java:1324)
      at
      org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow(DOMToDBMS.java:552)
      at
      org.xmlmiddleware.xmldbms.DOMToDBMS.processRoot(DOMToDBMS.java:447)
      at
      org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:368)
      at
      org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:317)
      at
      org.xmlmiddleware.xmldbms.tools.Transfer.storeDocumentInternal(Transfer.java:840)
      at
      org.xmlmiddleware.xmldbms.tools.Transfer.storeDocument(Transfer.java:479)
      at
      org.xmlmiddleware.xmldbms.tools.Transfer.dispatchStoreDocument(Transfer.java:696)
      at
      org.xmlmiddleware.xmldbms.tools.Transfer.dispatch(Transfer.java:434)
      at
      org.xmlmiddleware.xmldbms.tools.Transfer.main(Transfer.java:353)

      ==============================
      Here is the details of my environment:
      ----------
      db.props
      ----------
      #Properties for XML-DBMS
      URL=jdbc:mysql://localhost:3306/DLCImage
      Driver=com.mysql.jdbc.Driver
      DataSourceClass=org.xmlmiddleware.db.JDBC1DataSource
      DBName=DLCImage
      User=xxx
      Password=xxx

      ---------
      map.props
      ---------
      #Properties for MapManager
      Input=Database
      RootDatabase=DLCImage
      RootTable=Collections
      Output1=Map
      MapFile=Collections.map
      Output2=DTD
      DTDFile=Collections.dtd

      ------------
      parser.props
      ------------
      #Properties for XML-DBMS
      ParserUtilsClass=org.xmlmiddleware.xmlutils.external.ParserUtilsXerces

      -------------
      Collections.dtd -- got from MapManager tool
      -------------
      <!ELEMENT Description (#PCDATA)>

      <!ELEMENT Collection_name (#PCDATA)>

      <!ELEMENT Collection_id (#PCDATA)>

      <!ELEMENT Collections (Description, Collection_id, Collection_name)>

      --------------
      Collections.map -- got from MapManager tool
      --------------
      <?xml version='1.0' encoding="UTF8" ?>
      <!DOCTYPE XMLToDBMS >

      <XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
      <Options>
      <DecimalFormat DefaultForTypes="BIGINT TINYINT DOUBLE REAL FLOAT
      SMALLINT INTEGER DECIMAL NUMERIC" Pattern="#,##0.###"/>
      <FormatClass DefaultForTypes="BINARY VARBINARY LONGVARBINARY"
      Class="org.xmlmiddleware.conversions.formatters.NoFormatter"/>
      <SimpleDateFormat DefaultForTypes="TIMESTAMP" Pattern="MMM d,
      yyyy h:mm:ss a"/>
      <SimpleDateFormat DefaultForTypes="TIME" Pattern="h:mm:ss a"/>
      <SimpleDateFormat DefaultForTypes="DATE" Pattern="MMM d, yyyy"/>
      <FormatClass DefaultForTypes="BIT"
      Class="org.xmlmiddleware.conversions.formatters.BooleanFormatter"/>
      <FormatClass DefaultForTypes="LONGVARCHAR VARCHAR CHAR"
      Class="org.xmlmiddleware.conversions.formatters.CharFormatter"/>
      </Options>
      <Databases>
      <Database Name="DLCImage">
      <Catalog>
      <Schema>
      <Table Name="Collections">
      <Column Name="Description" DataType="LONGVARCHAR"
      Length="65535" Nullable="No"/>
      <Column Name="Collection_name" DataType="VARCHAR"
      Length="50" Nullable="No"/>
      <Column Name="Collection_id" DataType="INTEGER"
      Nullable="No"/>
      <PrimaryKey>
      <UseColumn Name="Collection_id"/>
      </PrimaryKey>
      </Table>
      </Schema>
      </Catalog>
      </Database>
      </Databases>
      <Maps>
      <ClassMap>
      <ElementType Name="Collections"/>
      <ToClassTable Database="DLCImage" Name="Collections"/>
      <PropertyMap TokenList="No" ContainsXML="No">
      <ElementType Name="Description"/>
      <ToColumn Name="Description"/>
      </PropertyMap>
      <PropertyMap TokenList="No" ContainsXML="No">
      <ElementType Name="Collection_id"/>
      <ToColumn Name="Collection_id"/>
      </PropertyMap>
      <PropertyMap TokenList="No" ContainsXML="No">
      <ElementType Name="Collection_name"/>
      <ToColumn Name="Collection_name"/>
      </PropertyMap>
      </ClassMap>
      </Maps>
      </XMLToDBMS>

      To use transfer tool, I defined transfer.props
      ---------------
      transfer.props
      ---------------
      Method=StoreDocument
      MapFile=Collections.map
      XMLFile=Collections.xml
      ActionFile=Collections.act

      ------------------
      Collections.act
      ------------------
      <!DOCTYPE Actions SYSTEM "actions.dtd">
      <Actions Version="2.0"
      xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
      <DefaultAction>
      <Insert />
      </DefaultAction>
      </Actions>
      =====================================
      And here is my Collections.xml file
      -----------------
      Collections.xml
      -----------------
      <?xml version="1.0" encoding="UTF-8"?>

      <Collections>
      <Collection_id>1</Collection_id>
      <Collection_name>Nepal</Collection_name>
      <Description>This is a test</Description>
      <Collection_id>2</Collection_id>
      <Collection_name>IASCP</Collection_name>
      <Description>Test IASCP</Description>
      <Collection_id>3</Collection_id>
      <Collection_name>Italy6-1978</Collection_name>
      <Description>Something</Description>
      <Collection_id>4</Collection_id>
      <Collection_name>Workshop</Collection_name>
      <Description>test</Description>
      <Collection_id>6</Collection_id>
      <Collection_name>ttest</Collection_name>
      <Collection_id>7</Collection_id>
      <Collection_name>YingTesting</Collection_name>
      </Collections>


      =========================

      I took orders as the example and tried to keep my things as simple as
      possible. However, I have no clue what thas error means.

      The command I used is
      java org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props
      File2=db.props File3=map.props
      java org.xmlmiddleware.xmldbms.tools.Transfer File1=parser.props
      File2=db.props File3=transfer.props

      Thanks for any help,
      Ying
    • Ronald Bourret
      Hello, The problem is probably that your XML document does not match your DTD. In particular, the DTD allows only a single collection ID, collection name, and
      Message 2 of 6 , Nov 17, 2005
      • 0 Attachment
        Hello,

        The problem is probably that your XML document does not match your DTD.
        In particular, the DTD allows only a single collection ID, collection
        name, and description in a Collections element. Your XML document
        includes information about multiple collections in a single Collections
        element.

        (The element name "Collections" is misleading, since it implies that
        there can be multiple collections in a Collections element. This
        illustrates the problems in automatically generating schemas -- the
        element name is taken from the table name, which is plural, but only
        describes a single row of data, which is singular.)

        You have two other problems with your XML document, neither of which is
        likely to be causing this problem:

        1) You don't always include a Description element in your XML document,
        but the DTD (and the database) requires this element. This shouldn't
        cause the problem you are seeing, but will cause an insert error, since
        the Description column in your database is non-nullable.

        2) The order of elements in your document doesn't match the order
        specified by the DTD. In particular, the children must be in the order
        Description, Collection_id, Collection_name, but your XML document has
        them in the order Collection_id, Collection_name, Description. I don't
        believe this will cause any problems for XML-DBMS, but this will cause
        problems if you try to validate your XML document against the generated DTD.


        To fix this problem:

        1) Change your DTD to add a Collection element, place child elements in
        the order you want them, and make the Description element optional:

        <!ELEMENT Collections (Collection+)>
        <!ELEMENT Collection (Collection_id, Collection_name, Description?)>
        <!ELEMENT Description (#PCDATA)>
        <!ELEMENT Collection_name (#PCDATA)>
        <!ELEMENT Collection_id (#PCDATA)>

        2) Change your database so that the Description column is non-nullable.

        3) In your map document, change the ElementType element in the ClassMap
        to map the Collection element, not the Collections element:

        <ElementType Name="Collection"/>

        4) Change your XML document to use the Collection element:

        <Collections>
        <Collection>
        <Collection_id>1</Collection_id>
        <Collection_name>Nepal</Collection_name>
        <Description>This is a test</Description>
        </Collection>
        <Collection>
        <Collection_id>2</Collection_id>
        <Collection_name>IASCP</Collection_name>
        <Description>Test IASCP</Description>
        </Collection>
        <Collection>
        <Collection_id>3</Collection_id>
        <Collection_name>Italy6-1978</Collection_name>
        <Description>Something</Description>
        </Collection>
        <Collection>
        <Collection_id>4</Collection_id>
        <Collection_name>Workshop</Collection_name>
        <Description>test</Description>
        </Collection>
        <Collection>
        <Collection_id>6</Collection_id>
        <Collection_name>ttest</Collection_name>
        </Collection>
        <Collection>
        <Collection_id>7</Collection_id>
        <Collection_name>YingTesting</Collection_name>
        </Collection>
        </Collections>

        -- Ron

        elsa_jin wrote:

        > Hi all,
        >
        > I just tried xmldbms days ago. What I'm trying to do is transfering
        > data from MS Access to MySQL database. I used MapManager tool to
        > generate a DTD file and a Map file from the database. It worked.
        > However, when I use transfer tool to transfer data, I got:
        > java.sql.SQLException: [XML-DBMS][SPPreparedStatement] Statement closed.
        > at
        > org.xmlmiddleware.db.SPPreparedStatement.checkState(SPPreparedStatement.java:833)
        > at
        > org.xmlmiddleware.db.SPPreparedStatement.setAsciiStream(SPPreparedStatement.java:313)
        > at
        > org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameter(Parameters.java:181)
        > at
        > org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameters(Parameters.java:89)
        > at
        > org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.makeInsert(DataHandlerBase.java:378)
        > at
        > org.xmlmiddleware.xmldbms.datahandlers.GenericHandler.insert(GenericHandler.java:49)
        > at
        > org.xmlmiddleware.xmldbms.DOMToDBMS.storeRow(DOMToDBMS.java:1324)
        > at
        > org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow(DOMToDBMS.java:552)
        > at
        > org.xmlmiddleware.xmldbms.DOMToDBMS.processRoot(DOMToDBMS.java:447)
        > at
        > org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:368)
        > at
        > org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:317)
        > at
        > org.xmlmiddleware.xmldbms.tools.Transfer.storeDocumentInternal(Transfer.java:840)
        > at
        > org.xmlmiddleware.xmldbms.tools.Transfer.storeDocument(Transfer.java:479)
        > at
        > org.xmlmiddleware.xmldbms.tools.Transfer.dispatchStoreDocument(Transfer.java:696)
        > at
        > org.xmlmiddleware.xmldbms.tools.Transfer.dispatch(Transfer.java:434)
        > at
        > org.xmlmiddleware.xmldbms.tools.Transfer.main(Transfer.java:353)
        >
        > ==============================
        > Here is the details of my environment:
        > ----------
        > db.props
        > ----------
        > #Properties for XML-DBMS
        > URL=jdbc:mysql://localhost:3306/DLCImage
        > Driver=com.mysql.jdbc.Driver
        > DataSourceClass=org.xmlmiddleware.db.JDBC1DataSource
        > DBName=DLCImage
        > User=xxx
        > Password=xxx
        >
        > ---------
        > map.props
        > ---------
        > #Properties for MapManager
        > Input=Database
        > RootDatabase=DLCImage
        > RootTable=Collections
        > Output1=Map
        > MapFile=Collections.map
        > Output2=DTD
        > DTDFile=Collections.dtd
        >
        > ------------
        > parser.props
        > ------------
        > #Properties for XML-DBMS
        > ParserUtilsClass=org.xmlmiddleware.xmlutils.external.ParserUtilsXerces
        >
        > -------------
        > Collections.dtd -- got from MapManager tool
        > -------------
        > <!ELEMENT Description (#PCDATA)>
        >
        > <!ELEMENT Collection_name (#PCDATA)>
        >
        > <!ELEMENT Collection_id (#PCDATA)>
        >
        > <!ELEMENT Collections (Description, Collection_id, Collection_name)>
        >
        > --------------
        > Collections.map -- got from MapManager tool
        > --------------
        > <?xml version='1.0' encoding="UTF8" ?>
        > <!DOCTYPE XMLToDBMS >
        >
        > <XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
        > <Options>
        > <DecimalFormat DefaultForTypes="BIGINT TINYINT DOUBLE REAL FLOAT
        > SMALLINT INTEGER DECIMAL NUMERIC" Pattern="#,##0.###"/>
        > <FormatClass DefaultForTypes="BINARY VARBINARY LONGVARBINARY"
        > Class="org.xmlmiddleware.conversions.formatters.NoFormatter"/>
        > <SimpleDateFormat DefaultForTypes="TIMESTAMP" Pattern="MMM d,
        > yyyy h:mm:ss a"/>
        > <SimpleDateFormat DefaultForTypes="TIME" Pattern="h:mm:ss a"/>
        > <SimpleDateFormat DefaultForTypes="DATE" Pattern="MMM d, yyyy"/>
        > <FormatClass DefaultForTypes="BIT"
        > Class="org.xmlmiddleware.conversions.formatters.BooleanFormatter"/>
        > <FormatClass DefaultForTypes="LONGVARCHAR VARCHAR CHAR"
        > Class="org.xmlmiddleware.conversions.formatters.CharFormatter"/>
        > </Options>
        > <Databases>
        > <Database Name="DLCImage">
        > <Catalog>
        > <Schema>
        > <Table Name="Collections">
        > <Column Name="Description" DataType="LONGVARCHAR"
        > Length="65535" Nullable="No"/>
        > <Column Name="Collection_name" DataType="VARCHAR"
        > Length="50" Nullable="No"/>
        > <Column Name="Collection_id" DataType="INTEGER"
        > Nullable="No"/>
        > <PrimaryKey>
        > <UseColumn Name="Collection_id"/>
        > </PrimaryKey>
        > </Table>
        > </Schema>
        > </Catalog>
        > </Database>
        > </Databases>
        > <Maps>
        > <ClassMap>
        > <ElementType Name="Collections"/>
        > <ToClassTable Database="DLCImage" Name="Collections"/>
        > <PropertyMap TokenList="No" ContainsXML="No">
        > <ElementType Name="Description"/>
        > <ToColumn Name="Description"/>
        > </PropertyMap>
        > <PropertyMap TokenList="No" ContainsXML="No">
        > <ElementType Name="Collection_id"/>
        > <ToColumn Name="Collection_id"/>
        > </PropertyMap>
        > <PropertyMap TokenList="No" ContainsXML="No">
        > <ElementType Name="Collection_name"/>
        > <ToColumn Name="Collection_name"/>
        > </PropertyMap>
        > </ClassMap>
        > </Maps>
        > </XMLToDBMS>
        >
        > To use transfer tool, I defined transfer.props
        > ---------------
        > transfer.props
        > ---------------
        > Method=StoreDocument
        > MapFile=Collections.map
        > XMLFile=Collections.xml
        > ActionFile=Collections.act
        >
        > ------------------
        > Collections.act
        > ------------------
        > <!DOCTYPE Actions SYSTEM "actions.dtd">
        > <Actions Version="2.0"
        > xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
        > <DefaultAction>
        > <Insert />
        > </DefaultAction>
        > </Actions>
        > =====================================
        > And here is my Collections.xml file
        > -----------------
        > Collections.xml
        > -----------------
        > <?xml version="1.0" encoding="UTF-8"?>
        >
        > <Collections>
        > <Collection_id>1</Collection_id>
        > <Collection_name>Nepal</Collection_name>
        > <Description>This is a test</Description>
        > <Collection_id>2</Collection_id>
        > <Collection_name>IASCP</Collection_name>
        > <Description>Test IASCP</Description>
        > <Collection_id>3</Collection_id>
        > <Collection_name>Italy6-1978</Collection_name>
        > <Description>Something</Description>
        > <Collection_id>4</Collection_id>
        > <Collection_name>Workshop</Collection_name>
        > <Description>test</Description>
        > <Collection_id>6</Collection_id>
        > <Collection_name>ttest</Collection_name>
        > <Collection_id>7</Collection_id>
        > <Collection_name>YingTesting</Collection_name>
        > </Collections>
        >
        >
        > =========================
        >
        > I took orders as the example and tried to keep my things as simple as
        > possible. However, I have no clue what thas error means.
        >
        > The command I used is
        > java org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props
        > File2=db.props File3=map.props
        > java org.xmlmiddleware.xmldbms.tools.Transfer File1=parser.props
        > File2=db.props File3=transfer.props
        >
        > Thanks for any help,
        > Ying
      • Hiral Shah
        Hi, I am a student working on a project to create an architecture for an ETL for XML data. I was wondering if there are in native XML databases in the market
        Message 3 of 6 , Nov 17, 2005
        • 0 Attachment
          Hi,
          I am a student working on a project to create an architecture for an ETL for XML data. I was wondering if there are in native XML databases in the market to store data in XML format. or if anyone could point me to the companies which might be working on native XML databases, I would really appreciate it.
          Thank you very much,
          Hiral


          Ronald Bourret <rpbourret@...> wrote: Hello,

          The problem is probably that your XML document does not match your DTD.
          In particular, the DTD allows only a single collection ID, collection
          name, and description in a Collections element. Your XML document
          includes information about multiple collections in a single Collections
          element.

          (The element name "Collections" is misleading, since it implies that
          there can be multiple collections in a Collections element. This
          illustrates the problems in automatically generating schemas -- the
          element name is taken from the table name, which is plural, but only
          describes a single row of data, which is singular.)

          You have two other problems with your XML document, neither of which is
          likely to be causing this problem:

          1) You don't always include a Description element in your XML document,
          but the DTD (and the database) requires this element. This shouldn't
          cause the problem you are seeing, but will cause an insert error, since
          the Description column in your database is non-nullable.

          2) The order of elements in your document doesn't match the order
          specified by the DTD. In particular, the children must be in the order
          Description, Collection_id, Collection_name, but your XML document has
          them in the order Collection_id, Collection_name, Description. I don't
          believe this will cause any problems for XML-DBMS, but this will cause
          problems if you try to validate your XML document against the generated DTD.


          To fix this problem:

          1) Change your DTD to add a Collection element, place child elements in
          the order you want them, and make the Description element optional:

          <!ELEMENT Collections (Collection+)>
          <!ELEMENT Collection (Collection_id, Collection_name, Description?)>
          <!ELEMENT Description (#PCDATA)>
          <!ELEMENT Collection_name (#PCDATA)>
          <!ELEMENT Collection_id (#PCDATA)>

          2) Change your database so that the Description column is non-nullable.

          3) In your map document, change the ElementType element in the ClassMap
          to map the Collection element, not the Collections element:

          <ElementType Name="Collection"/>

          4) Change your XML document to use the Collection element:

          <Collections>
          <Collection>
          <Collection_id>1</Collection_id>
          <Collection_name>Nepal</Collection_name>
          <Description>This is a test</Description>
          </Collection>
          <Collection>
          <Collection_id>2</Collection_id>
          <Collection_name>IASCP</Collection_name>
          <Description>Test IASCP</Description>
          </Collection>
          <Collection>
          <Collection_id>3</Collection_id>
          <Collection_name>Italy6-1978</Collection_name>
          <Description>Something</Description>
          </Collection>
          <Collection>
          <Collection_id>4</Collection_id>
          <Collection_name>Workshop</Collection_name>
          <Description>test</Description>
          </Collection>
          <Collection>
          <Collection_id>6</Collection_id>
          <Collection_name>ttest</Collection_name>
          </Collection>
          <Collection>
          <Collection_id>7</Collection_id>
          <Collection_name>YingTesting</Collection_name>
          </Collection>
          </Collections>

          -- Ron

          elsa_jin wrote:

          > Hi all,
          >
          > I just tried xmldbms days ago. What I'm trying to do is transfering
          > data from MS Access to MySQL database. I used MapManager tool to
          > generate a DTD file and a Map file from the database. It worked.
          > However, when I use transfer tool to transfer data, I got:
          > java.sql.SQLException: [XML-DBMS][SPPreparedStatement] Statement closed.
          > at
          > org.xmlmiddleware.db.SPPreparedStatement.checkState(SPPreparedStatement.java:833)
          > at
          > org.xmlmiddleware.db.SPPreparedStatement.setAsciiStream(SPPreparedStatement.java:313)
          > at
          > org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameter(Parameters.java:181)
          > at
          > org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameters(Parameters.java:89)
          > at
          > org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.makeInsert(DataHandlerBase.java:378)
          > at
          > org.xmlmiddleware.xmldbms.datahandlers.GenericHandler.insert(GenericHandler.java:49)
          > at
          > org.xmlmiddleware.xmldbms.DOMToDBMS.storeRow(DOMToDBMS.java:1324)
          > at
          > org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow(DOMToDBMS.java:552)
          > at
          > org.xmlmiddleware.xmldbms.DOMToDBMS.processRoot(DOMToDBMS.java:447)
          > at
          > org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:368)
          > at
          > org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:317)
          > at
          > org.xmlmiddleware.xmldbms.tools.Transfer.storeDocumentInternal(Transfer.java:840)
          > at
          > org.xmlmiddleware.xmldbms.tools.Transfer.storeDocument(Transfer.java:479)
          > at
          > org.xmlmiddleware.xmldbms.tools.Transfer.dispatchStoreDocument(Transfer.java:696)
          > at
          > org.xmlmiddleware.xmldbms.tools.Transfer.dispatch(Transfer.java:434)
          > at
          > org.xmlmiddleware.xmldbms.tools.Transfer.main(Transfer.java:353)
          >
          > ==============================
          > Here is the details of my environment:
          > ----------
          > db.props
          > ----------
          > #Properties for XML-DBMS
          > URL=jdbc:mysql://localhost:3306/DLCImage
          > Driver=com.mysql.jdbc.Driver
          > DataSourceClass=org.xmlmiddleware.db.JDBC1DataSource
          > DBName=DLCImage
          > User=xxx
          > Password=xxx
          >
          > ---------
          > map.props
          > ---------
          > #Properties for MapManager
          > Input=Database
          > RootDatabase=DLCImage
          > RootTable=Collections
          > Output1=Map
          > MapFile=Collections.map
          > Output2=DTD
          > DTDFile=Collections.dtd
          >
          > ------------
          > parser.props
          > ------------
          > #Properties for XML-DBMS
          > ParserUtilsClass=org.xmlmiddleware.xmlutils.external.ParserUtilsXerces
          >
          > -------------
          > Collections.dtd -- got from MapManager tool
          > -------------
          > <!ELEMENT Description (#PCDATA)>
          >
          > <!ELEMENT Collection_name (#PCDATA)>
          >
          > <!ELEMENT Collection_id (#PCDATA)>
          >
          > <!ELEMENT Collections (Description, Collection_id, Collection_name)>
          >
          > --------------
          > Collections.map -- got from MapManager tool
          > --------------
          > <?xml version='1.0' encoding="UTF8" ?>
          > <!DOCTYPE XMLToDBMS >
          >
          > <XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
          > <Options>
          > <DecimalFormat DefaultForTypes="BIGINT TINYINT DOUBLE REAL FLOAT
          > SMALLINT INTEGER DECIMAL NUMERIC" Pattern="#,##0.###"/>
          > <FormatClass DefaultForTypes="BINARY VARBINARY LONGVARBINARY"
          > Class="org.xmlmiddleware.conversions.formatters.NoFormatter"/>
          > <SimpleDateFormat DefaultForTypes="TIMESTAMP" Pattern="MMM d,
          > yyyy h:mm:ss a"/>
          > <SimpleDateFormat DefaultForTypes="TIME" Pattern="h:mm:ss a"/>
          > <SimpleDateFormat DefaultForTypes="DATE" Pattern="MMM d, yyyy"/>
          > <FormatClass DefaultForTypes="BIT"
          > Class="org.xmlmiddleware.conversions.formatters.BooleanFormatter"/>
          > <FormatClass DefaultForTypes="LONGVARCHAR VARCHAR CHAR"
          > Class="org.xmlmiddleware.conversions.formatters.CharFormatter"/>
          > </Options>
          > <Databases>
          > <Database Name="DLCImage">
          > <Catalog>
          > <Schema>
          > <Table Name="Collections">
          > <Column Name="Description" DataType="LONGVARCHAR"
          > Length="65535" Nullable="No"/>
          > <Column Name="Collection_name" DataType="VARCHAR"
          > Length="50" Nullable="No"/>
          > <Column Name="Collection_id" DataType="INTEGER"
          > Nullable="No"/>
          > <PrimaryKey>
          > <UseColumn Name="Collection_id"/>
          > </PrimaryKey>
          > </Table>
          > </Schema>
          > </Catalog>
          > </Database>
          > </Databases>
          > <Maps>
          > <ClassMap>
          > <ElementType Name="Collections"/>
          > <ToClassTable Database="DLCImage" Name="Collections"/>
          > <PropertyMap TokenList="No" ContainsXML="No">
          > <ElementType Name="Description"/>
          > <ToColumn Name="Description"/>
          > </PropertyMap>
          > <PropertyMap TokenList="No" ContainsXML="No">
          > <ElementType Name="Collection_id"/>
          > <ToColumn Name="Collection_id"/>
          > </PropertyMap>
          > <PropertyMap TokenList="No" ContainsXML="No">
          > <ElementType Name="Collection_name"/>
          > <ToColumn Name="Collection_name"/>
          > </PropertyMap>
          > </ClassMap>
          > </Maps>
          > </XMLToDBMS>
          >
          > To use transfer tool, I defined transfer.props
          > ---------------
          > transfer.props
          > ---------------
          > Method=StoreDocument
          > MapFile=Collections.map
          > XMLFile=Collections.xml
          > ActionFile=Collections.act
          >
          > ------------------
          > Collections.act
          > ------------------
          > <!DOCTYPE Actions SYSTEM "actions.dtd">
          > <Actions Version="2.0"
          > xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
          > <DefaultAction>
          > <Insert />
          > </DefaultAction>
          > </Actions>
          > =====================================
          > And here is my Collections.xml file
          > -----------------
          > Collections.xml
          > -----------------
          > <?xml version="1.0" encoding="UTF-8"?>
          >
          > <Collections>
          > <Collection_id>1</Collection_id>
          > <Collection_name>Nepal</Collection_name>
          > <Description>This is a test</Description>
          > <Collection_id>2</Collection_id>
          > <Collection_name>IASCP</Collection_name>
          > <Description>Test IASCP</Description>
          > <Collection_id>3</Collection_id>
          > <Collection_name>Italy6-1978</Collection_name>
          > <Description>Something</Description>
          > <Collection_id>4</Collection_id>
          > <Collection_name>Workshop</Collection_name>
          > <Description>test</Description>
          > <Collection_id>6</Collection_id>
          > <Collection_name>ttest</Collection_name>
          > <Collection_id>7</Collection_id>
          > <Collection_name>YingTesting</Collection_name>
          > </Collections>
          >
          >
          > =========================
          >
          > I took orders as the example and tried to keep my things as simple as
          > possible. However, I have no clue what thas error means.
          >
          > The command I used is
          > java org.xmlmiddleware.xmldbms.tools.MapManager File1=parser.props
          > File2=db.props File3=map.props
          > java org.xmlmiddleware.xmldbms.tools.Transfer File1=parser.props
          > File2=db.props File3=transfer.props
          >
          > Thanks for any help,
          > Ying





          To post a message, send it to: xml-dbms@yahoogroups.com
          To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com



          SPONSORED LINKS
          Xml database Xml document How to format a computer hard drive Java xml How to format a computer

          ---------------------------------
          YAHOO! GROUPS LINKS


          Visit your group "xml-dbms" on the web.

          To unsubscribe from this group, send an email to:
          xml-dbms-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---------------------------------






          ---------------------------------
          Yahoo! FareChase - Search multiple travel sites in one click.

          [Non-text portions of this message have been removed]
        • Ronald Bourret
          See http://www.rpbourret.com/xml/ProdsNative.htm If you want an Open Source native XML database, I recommend eXist or Berkeley DB XML. -- Ron
          Message 4 of 6 , Nov 17, 2005
          • 0 Attachment
            See http://www.rpbourret.com/xml/ProdsNative.htm

            If you want an Open Source native XML database, I recommend eXist or
            Berkeley DB XML.

            -- Ron

            Hiral Shah wrote:
            > Hi,
            > I am a student working on a project to create an architecture for an ETL for XML data. I was wondering if there are in native XML databases in the market to store data in XML format. or if anyone could point me to the companies which might be working on native XML databases, I would really appreciate it.
            > Thank you very much,
            > Hiral
          • Ying Jin
            Dear Ronald, Thanks for your reply. I have made the changes you suggested in the following message and I m still getting the same error. 1. I have changed the
            Message 5 of 6 , Nov 28, 2005
            • 0 Attachment
              Dear Ronald,

              Thanks for your reply. I have made the changes you
              suggested in the following message and I'm still
              getting the same error.

              1. I have changed the Description column to nullable.
              2. Change the DTD file as you suggested.
              3. Change the XML file as you suggested.

              I think this time the XML file matches the DTD file.
              Here is the SQL statement I used to create the
              Collections table.

              CREATE TABLE Collections (
              Collection_id INT UNSIGNED NOT NULL,
              Collection_name VARCHAR(50) NOT NULL,
              Description VARCHAR(500),
              CONSTRAINT PrimaryKey PRIMARY KEY (`Collection_id`)
              );

              I deleted all records in this table too.

              Any clue?

              Thanks very much,
              Ying

              --- Ronald Bourret <rpbourret@...> wrote:

              > Hello,
              >
              > The problem is probably that your XML document does
              > not match your DTD.
              > In particular, the DTD allows only a single
              > collection ID, collection
              > name, and description in a Collections element. Your
              > XML document
              > includes information about multiple collections in a
              > single Collections
              > element.
              >
              > (The element name "Collections" is misleading, since
              > it implies that
              > there can be multiple collections in a Collections
              > element. This
              > illustrates the problems in automatically generating
              > schemas -- the
              > element name is taken from the table name, which is
              > plural, but only
              > describes a single row of data, which is singular.)
              >
              > You have two other problems with your XML document,
              > neither of which is
              > likely to be causing this problem:
              >
              > 1) You don't always include a Description element in
              > your XML document,
              > but the DTD (and the database) requires this
              > element. This shouldn't
              > cause the problem you are seeing, but will cause an
              > insert error, since
              > the Description column in your database is
              > non-nullable.
              >
              > 2) The order of elements in your document doesn't
              > match the order
              > specified by the DTD. In particular, the children
              > must be in the order
              > Description, Collection_id, Collection_name, but
              > your XML document has
              > them in the order Collection_id, Collection_name,
              > Description. I don't
              > believe this will cause any problems for XML-DBMS,
              > but this will cause
              > problems if you try to validate your XML document
              > against the generated DTD.
              >
              >
              > To fix this problem:
              >
              > 1) Change your DTD to add a Collection element,
              > place child elements in
              > the order you want them, and make the Description
              > element optional:
              >
              > <!ELEMENT Collections (Collection+)>
              > <!ELEMENT Collection (Collection_id,
              > Collection_name, Description?)>
              > <!ELEMENT Description (#PCDATA)>
              > <!ELEMENT Collection_name (#PCDATA)>
              > <!ELEMENT Collection_id (#PCDATA)>
              >
              > 2) Change your database so that the Description
              > column is non-nullable.
              >
              > 3) In your map document, change the ElementType
              > element in the ClassMap
              > to map the Collection element, not the Collections
              > element:
              >
              > <ElementType Name="Collection"/>
              >
              > 4) Change your XML document to use the Collection
              > element:
              >
              > <Collections>
              > <Collection>
              > <Collection_id>1</Collection_id>
              > <Collection_name>Nepal</Collection_name>
              > <Description>This is a test</Description>
              > </Collection>
              > <Collection>
              > <Collection_id>2</Collection_id>
              > <Collection_name>IASCP</Collection_name>
              > <Description>Test IASCP</Description>
              > </Collection>
              > <Collection>
              > <Collection_id>3</Collection_id>
              > <Collection_name>Italy6-1978</Collection_name>
              > <Description>Something</Description>
              > </Collection>
              > <Collection>
              > <Collection_id>4</Collection_id>
              > <Collection_name>Workshop</Collection_name>
              > <Description>test</Description>
              > </Collection>
              > <Collection>
              > <Collection_id>6</Collection_id>
              > <Collection_name>ttest</Collection_name>
              > </Collection>
              > <Collection>
              > <Collection_id>7</Collection_id>
              > <Collection_name>YingTesting</Collection_name>
              > </Collection>
              > </Collections>
              >
              > -- Ron
              >
              > elsa_jin wrote:
              >
              > > Hi all,
              > >
              > > I just tried xmldbms days ago. What I'm trying to
              > do is transfering
              > > data from MS Access to MySQL database. I used
              > MapManager tool to
              > > generate a DTD file and a Map file from the
              > database. It worked.
              > > However, when I use transfer tool to transfer
              > data, I got:
              > > java.sql.SQLException:
              > [XML-DBMS][SPPreparedStatement] Statement closed.
              > > at
              > >
              >
              org.xmlmiddleware.db.SPPreparedStatement.checkState(SPPreparedStatement.java:833)
              > > at
              > >
              >
              org.xmlmiddleware.db.SPPreparedStatement.setAsciiStream(SPPreparedStatement.java:313)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameter(Parameters.java:181)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.datahandlers.Parameters.setParameters(Parameters.java:89)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.datahandlers.DataHandlerBase.makeInsert(DataHandlerBase.java:378)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.datahandlers.GenericHandler.insert(GenericHandler.java:49)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.DOMToDBMS.storeRow(DOMToDBMS.java:1324)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow(DOMToDBMS.java:552)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.DOMToDBMS.processRoot(DOMToDBMS.java:447)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:368)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.DOMToDBMS.storeDocument(DOMToDBMS.java:317)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.tools.Transfer.storeDocumentInternal(Transfer.java:840)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.tools.Transfer.storeDocument(Transfer.java:479)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.tools.Transfer.dispatchStoreDocument(Transfer.java:696)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.tools.Transfer.dispatch(Transfer.java:434)
              > > at
              > >
              >
              org.xmlmiddleware.xmldbms.tools.Transfer.main(Transfer.java:353)
              > >
              > > ==============================
              > > Here is the details of my environment:
              > > ----------
              > > db.props
              > > ----------
              > > #Properties for XML-DBMS
              > > URL=jdbc:mysql://localhost:3306/DLCImage
              > > Driver=com.mysql.jdbc.Driver
              > >
              > DataSourceClass=org.xmlmiddleware.db.JDBC1DataSource
              > > DBName=DLCImage
              > > User=xxx
              > > Password=xxx
              > >
              > > ---------
              > > map.props
              > > ---------
              > > #Properties for MapManager
              > > Input=Database
              > > RootDatabase=DLCImage
              > > RootTable=Collections
              > > Output1=Map
              > > MapFile=Collections.map
              > > Output2=DTD
              > > DTDFile=Collections.dtd
              > >
              > > ------------
              > > parser.props
              > > ------------
              >
              === message truncated ===





              __________________________________
              Yahoo! Mail - PC Magazine Editors' Choice 2005
              http://mail.yahoo.com
            • Ronald Bourret
              Hello, I just realized I never answered this. Are you still having this problem? I tried to recreate the problem here and was not able to. I used the following
              Message 6 of 6 , Dec 15, 2005
              • 0 Attachment
                Hello,

                I just realized I never answered this. Are you still having this problem?

                I tried to recreate the problem here and was not able to. I used the
                following command:

                java org.xmlmiddleware.xmldbms.tools.Transfer File1=parser.props
                File2=db.props File3=transfer.props

                and the files listed below.

                I then looked through the code. This part of the code is pretty
                confusing, but I was not able to find a way for this error to occur. In
                particular, none of the code in DOMToDBMS ever closes the JDBC statement
                or connection, so I couldn't figure out what was happening.

                -- Ron

                collections.act
                ---------------
                <Actions Version="2.0"
                xmlns="http://www.xmlmiddleware.org/xmldbms/actions/v2">
                <DefaultAction>
                <Insert />
                </DefaultAction>
                </Actions>

                collections.map
                ---------------
                <!DOCTYPE XMLToDBMS >
                <XMLToDBMS Version="2.0" xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
                <Databases>
                <Database Name="DLCImage">
                <Catalog>
                <Schema>
                <Table Name="Collections">
                <Column Name="Description" DataType="LONGVARCHAR" Length="65535"
                Nullable="Yes"/>
                <Column Name="Collection_name" DataType="VARCHAR" Length="50"
                Nullable="No"/>
                <Column Name="Collection_id" DataType="INTEGER" Nullable="No"/>
                <PrimaryKey>
                <UseColumn Name="Collection_id"/>
                </PrimaryKey>
                </Table>
                </Schema>
                </Catalog>
                </Database>
                </Databases>
                <Maps>
                <ClassMap>
                <ElementType Name="Collection"/>
                <ToClassTable Database="DLCImage" Name="Collections"/>
                <PropertyMap TokenList="No" ContainsXML="No">
                <ElementType Name="Description"/>
                <ToColumn Name="Description"/>
                </PropertyMap>
                <PropertyMap TokenList="No" ContainsXML="No">
                <ElementType Name="Collection_id"/>
                <ToColumn Name="Collection_id"/>
                </PropertyMap>
                <PropertyMap TokenList="No" ContainsXML="No">
                <ElementType Name="Collection_name"/>
                <ToColumn Name="Collection_name"/>
                </PropertyMap>
                </ClassMap>
                </Maps>
                </XMLToDBMS>

                collections.xml
                ---------------
                <Collections>
                <Collection>
                <Collection_id>1</Collection_id>
                <Collection_name>Nepal</Collection_name>
                <Description>This is a test</Description>
                </Collection>
                <Collection>
                <Collection_id>2</Collection_id>
                <Collection_name>IASCP</Collection_name>
                <Description>Test IASCP</Description>
                </Collection>
                <Collection>
                <Collection_id>3</Collection_id>
                <Collection_name>Italy6-1978</Collection_name>
                <Description>Something</Description>
                </Collection>
                <Collection>
                <Collection_id>4</Collection_id>
                <Collection_name>Workshop</Collection_name>
                <Description>test</Description>
                </Collection>
                <Collection>
                <Collection_id>6</Collection_id>
                <Collection_name>ttest</Collection_name>
                </Collection>
                <Collection>
                <Collection_id>7</Collection_id>
                <Collection_name>YingTesting</Collection_name>
                </Collection>
                </Collections>

                db.props
                --------
                #Properties for XML-DBMS
                URL=jdbc:odbc:test
                Driver=sun.jdbc.odbc.JdbcOdbcDriver
                DataSourceClass=org.xmlmiddleware.db.JDBC1DataSource
                DBName=DLCImage

                parser.props
                ------------
                #Properties for XML-DBMS
                ParserUtilsClass=org.xmlmiddleware.xmlutils.external.ParserUtilsXerces

                transfer.props
                --------------
                Method=StoreDocument
                MapFile=Collections.map
                XMLFile=Collections.xml
                ActionFile=Collections.act

                Ying Jin wrote:

                > Dear Ronald,
                >
                > Thanks for your reply. I have made the changes you
                > suggested in the following message and I'm still
                > getting the same error.
                >
                > 1. I have changed the Description column to nullable.
                > 2. Change the DTD file as you suggested.
                > 3. Change the XML file as you suggested.
                >
                > I think this time the XML file matches the DTD file.
                > Here is the SQL statement I used to create the
                > Collections table.
                >
                > CREATE TABLE Collections (
                > Collection_id INT UNSIGNED NOT NULL,
                > Collection_name VARCHAR(50) NOT NULL,
                > Description VARCHAR(500),
                > CONSTRAINT PrimaryKey PRIMARY KEY (`Collection_id`)
                > );
                >
                > I deleted all records in this table too.
                >
                > Any clue?
                >
                > Thanks very much,
                > Ying
              Your message has been successfully submitted and would be delivered to recipients shortly.