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

Re: [xml-dbms] (unknown)

Expand Messages
  • Ronald Bourret
    ... Some databases have a three-part naming system for tables: catalog name, schema name, and table name. Others only use a two-part naming system. For
    Message 1 of 26 , Mar 10, 2003
      Harsh Poddar wrote:
      >
      > i got stuck in the following places in MapManager.java :
      >
      > 1.wat are catalog names & schema names ?

      Some databases have a three-part naming system for tables: catalog name,
      schema name, and table name. Others only use a two-part naming system.
      For example, MS Access uses catalog names (the name of the .mdb file)
      and table name. For information on what your database supports, see the
      documentation for your database.

      > 2.inspite of several attempts to search for 'Properties' class &
      > 'getProperty' method,it was useless..so,plz tell me where are they kept
      > in the package ?

      java.util.Properties

      > 3.wat r namespaceuris & dbInfos ?

      Namespace URIs are used in XML namespaces. For more information about
      XML namespaces, see:

      http://www.rpbourret.com/xml/NamespacesFAQ.htm

      dbInfos is a hashtable of information about each database used by
      MapManager. You should not care about dbInfos, as it is internal to the
      MapManager class, which you do not need to modify.

      > 4.wat r 'order options' in a dtd ?

      XML-DBMS has three ways to handle sibling order. (By "sibling order", I
      mean the order in which child elements occur in their parent.)

      The first way is to ignore sibling order. In this case, there is no
      guarantee what order children will occur in their parent.

      The second way is with an order column. This is a special column in the
      database that remembers the position in which an element occurred in its
      parent. For more information, see:

      http://www.rpbourret.com/xmldbms/readme.htm#LangMixed

      The third way is with a fixed order value. For example, element A is
      always the first child, element B is always the second child, etc.

      The OrderType property tells MapManager which of the above methods to
      use in the generated map.

      For more information, see the link in (5).

      > 5.where can i get the basic theory of this transformation ? an internet
      > link concerning this matter will be highly welcome...

      http://www.xml.com/pub/a/2001/05/09/dtdtodbs.html

      I think this will help a lot in understanding how XML-DBMS works. Note
      that this article does not directly discuss XML-DBMS. Instead, it
      discusses the theory on which XML-DBMS is based.

      > 6.i made some changes in MapManager.java..after that,when i tried to
      > compile it,it gave the following error :
      >
      > generator might not have been initialised ...
      >
      > the above error was reported at the line containing the
      > following code :
      > generator=createTablefromstrings(map);
      >
      > i checked out...DDLGenerator class was included in import statements &
      > the constructor was also present...i m pretty confused by this...

      I have no idea what caused this error. However, you do not need to
      modify MapManager. The code I sent earlier should be used in your own
      application. This is much safer than modifying MapManager, since your
      application can then use the standard MapManager code.

      > one more thing..are 1,3,4 necessary,if i just want to generate the
      > map file & the sql file from the dtd ?

      (1) is necessary if you want to generate CREATE TABLE statements that
      create tables in a particular catalog and schema.

      (3) is internal to MapManager and is therefore not necessary.

      (4) is necessary because you need to tell MapManager how it should
      handle sibling order.

      -- Ron
    • Harsh Poddar
      1.Can u tell me,wat kind of naming system is used in oracle 8i ? 2.regarding the code given below,are getMyDBprops,getMyConfigProps etc built-in methods or
      Message 2 of 26 , Mar 10, 2003
        1.Can u tell me,wat kind of naming system is used in oracle 8i ?

        2.regarding the code given below,are getMyDBprops,getMyConfigProps etc
        built-in methods or already present in the package or do i have to
        write them separately ? by ConfigProps,do u mean Parser.Props ?
        3.which files shall i import in this application ?


        > --- Ronald Bourret <rpbourret@...> wrote:
        > ---------------------------------
        > Here's a rough outline of the code. You will need to modify it for
        your
        > specific needs (MapManager properties, DTD file, JDBC driver, XML
        > parser, etc.) For more information, see the JavaDocs for JDBC
        > (java.sql.*) and XML-DBMS.
        >
        > -- Ron
        >
        > // Call a private method to get the ParserUtils implementation
        > // that you are using.
        >
        > ParserUtils utils = getMyParserUtils();
        >
        > // Create a new MapManager.
        >
        > MapManager manager = new MapManager(utils);
        >
        > // Call private methods to get the database props, configuration
        > // props, and name of the DTD file.
        >
        > Properties dbProps = getMyDBProps();
        > Properties configProps = getMyConfigProps();
        > String dtdFilename = getMyDTTDFilename();
        >
        > // Create an XMLDBMSMap.
        >
        > XMLDBMSMap map = manager.createMapFromDTD(dbProps, configProps,
        > dtdFilename);
        >
        > // Get a connection to the database.
        >
        > Class.forName(??your JDBC driver class name here??);
        > Connection conn = DriverManager.getConnection(??your database url,
        > ??user name,
        > ??password);
        > DatabaseMetaData meta = conn.getMetaData();
        >
        > // Get a DDLGenerator object and generate the CREATE TABLE statements
        >
        > DDLGenerator generator = new DDLGenerator(null, meta);
        > String[] createTableStmts = generator.getCreateTableStrings(map);
        >
        > // Iterate through the list of create table strings and execute them
        >
        > Statement stmt = conn.createStatement();
        > for (int i = 0; i < createTableStmts.length; i++)
        > {
        > stmt.executeUpdate(createTableStmts[i]);
        > }
        >
        > // Close the statmenet and the connection.
        >
        > stmt.close();
        > conn.close();

        Yahoo! Groups SponsorADVERTISEMENT

        To post a message, send it to: xml-dbms@yahoogroups.com
        To unsubscribe, send a blank message to:
        xml-dbms-unsubscribe@yahoogroups.com
        Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms

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

        =====
        Genius is,more often than not,mere perseverance in disguise.

        Room no 213/E
        NIT Calicut(kerala)
        phone no->(0495) - 2287287
        alt. id->justmailharsh@...

        ________________________________________________________________________
        Missed your favourite TV serial last night? Try the new, Yahoo! TV.
        visit http://in.tv.yahoo.com
      • Ronald Bourret
        ... No. You need to look at the Oracle documentation. ... You need to write these separately. They build the Properties objects that you want to use with
        Message 3 of 26 , Mar 10, 2003
          Harsh Poddar wrote:
          >
          > 1.Can u tell me,wat kind of naming system is used in oracle 8i ?

          No. You need to look at the Oracle documentation.

          > 2.regarding the code given below,are getMyDBprops,getMyConfigProps etc
          > built-in methods or already present in the package or do i have to
          > write them separately ? by ConfigProps,do u mean Parser.Props ?

          You need to write these separately. They build the Properties objects
          that you want to use with MapManager. For a list of properties that
          MapManager accepts, see the JavaDocs for MapManager
          (org.xmlmiddleware.xmldbms.tools.MapManager). That explains what is
          meant by configuration properties, parser properties, database
          properties, etc.

          > 3.which files shall i import in this application ?

          This is left as an exercise for the reader (you). If you have any
          questions about which package an object or method is in, search
          AllNames.html in the docs subdirectory of the directory you installed
          XML-DBMS in.

          -- Ron
        Your message has been successfully submitted and would be delivered to recipients shortly.