Java API


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Java API

  1. #1
    Join Date
    Jun 2009
    Posts
    6

    Java API

    Hello,
    Does anyone know or have a code to querying multiple xml files using java? The idea is to import all xml files to a sql database then query the database via odbc.

    Thanks,
    Last edited by lamin; 06-09-2009 at 10:11 AM.

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    There are many XML functions implemented in the members of the javax.xml.* packages which you can find in the JDK.

    You can use JDOM (www.jdom.org) for your Document Object Model processes to read and export the XML data.

    Why would you use ODBC rather than JDBC? See http://www.devx.com/dbzone/Article/33482

  3. #3
    Join Date
    Jun 2009
    Posts
    6
    I am trying to import a bujnce of xml files to ms sql database, and then i am going to create a program that query that database for another application. My biggest obstacle is to get those xml file to the database. Below is the sample of one of the files. In that file i want to get the values of TRAFFIC_IN and TRAFFIC_OUT. By the way the xml files are updated every 5 min which means that every 5 min a new data is recorded in the file. Any assistance will be greatly appreciated.



    <!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
    <step> 300 </step> <!-- Seconds -->
    <lastupdate> 1244726882 </lastupdate> <!-- 2009-06-11 09:28:02 Eastern Daylight Time -->

    <ds>
    <name> traffic_out </name>
    <type> GAUGE </type>
    <minimal_heartbeat> 600 </minimal_heartbeat>
    <min> 0.0000000000e+000 </min>
    <max> 3.0000000000e+004 </max>

    <!-- PDP Status -->
    <last_ds> U </last_ds>
    <value> NaN </value>
    <unknown_sec> 182 </unknown_sec>
    </ds>

    <ds>
    <name> traffic_in </name>
    <type> GAUGE </type>
    <minimal_heartbeat> 600 </minimal_heartbeat>
    <min> 0.0000000000e+000 </min>
    <max> 3.0000000000e+004 </max>

    <!-- PDP Status -->
    <last_ds> U </last_ds>
    <value> NaN </value>
    <unknown_sec> 182 </unknown_sec>
    </ds>

    <!-- Round Robin Archives --> <rra>
    <cf> LAST </cf>
    <pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->

    <params>
    <xff> 5.0000000000e-001 </xff>
    </params>
    <cdp_prep>
    <ds>
    <primary_value> NaN </primary_value>
    <secondary_value> 0.0000000000e+000 </secondary_value>
    <value> NaN </value>
    <unknown_datapoints> 0 </unknown_datapoints>
    </ds>
    <ds>
    <primary_value> NaN </primary_value>
    <secondary_value> 0.0000000000e+000 </secondary_value>
    <value> NaN </value>
    <unknown_datapoints> 0 </unknown_datapoints>
    </ds>
    </cdp_prep>
    <database>
    <!-- 2009-06-09 07:30:00 Eastern Daylight Time / 1244547000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 07:35:00 Eastern Daylight Time / 1244547300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 07:40:00 Eastern Daylight Time / 1244547600 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 07:45:00 Eastern Daylight Time / 1244547900 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 07:50:00 Eastern Daylight Time / 1244548200 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 07:55:00 Eastern Daylight Time / 1244548500 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:00:00 Eastern Daylight Time / 1244548800 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:05:00 Eastern Daylight Time / 1244549100 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:10:00 Eastern Daylight Time / 1244549400 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:15:00 Eastern Daylight Time / 1244549700 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:20:00 Eastern Daylight Time / 1244550000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:25:00 Eastern Daylight Time / 1244550300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:30:00 Eastern Daylight Time / 1244550600 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:35:00 Eastern Daylight Time / 1244550900 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:40:00 Eastern Daylight Time / 1244551200 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:45:00 Eastern Daylight Time / 1244551500 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:50:00 Eastern Daylight Time / 1244551800 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 08:55:00 Eastern Daylight Time / 1244552100 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:00:00 Eastern Daylight Time / 1244552400 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:05:00 Eastern Daylight Time / 1244552700 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:10:00 Eastern Daylight Time / 1244553000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:15:00 Eastern Daylight Time / 1244553300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:20:00 Eastern Daylight Time / 1244553600 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:25:00 Eastern Daylight Time / 1244553900 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:30:00 Eastern Daylight Time / 1244554200 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:35:00 Eastern Daylight Time / 1244554500 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:40:00 Eastern Daylight Time / 1244554800 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:45:00 Eastern Daylight Time / 1244555100 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:50:00 Eastern Daylight Time / 1244555400 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 09:55:00 Eastern Daylight Time / 1244555700 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:00:00 Eastern Daylight Time / 1244556000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:05:00 Eastern Daylight Time / 1244556300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:10:00 Eastern Daylight Time / 1244556600 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:15:00 Eastern Daylight Time / 1244556900 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:20:00 Eastern Daylight Time / 1244557200 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:25:00 Eastern Daylight Time / 1244557500 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:30:00 Eastern Daylight Time / 1244557800 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:35:00 Eastern Daylight Time / 1244558100 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:40:00 Eastern Daylight Time / 1244558400 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:45:00 Eastern Daylight Time / 1244558700 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:50:00 Eastern Daylight Time / 1244559000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 10:55:00 Eastern Daylight Time / 1244559300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:00:00 Eastern Daylight Time / 1244559600 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:05:00 Eastern Daylight Time / 1244559900 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:10:00 Eastern Daylight Time / 1244560200 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:15:00 Eastern Daylight Time / 1244560500 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:20:00 Eastern Daylight Time / 1244560800 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:25:00 Eastern Daylight Time / 1244561100 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:30:00 Eastern Daylight Time / 1244561400 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:35:00 Eastern Daylight Time / 1244561700 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:40:00 Eastern Daylight Time / 1244562000 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:45:00 Eastern Daylight Time / 1244562300 --> <row><v> NaN </v><v> NaN </v></row>
    <!-- 2009-06-09 11:50:00 Eastern Daylight Time / 1244562600 --> <row><v> NaN </v><v> NaN </v></row>

Similar Threads

  1. Sun JAXB: Java API for XML Binding, Castor
    By Anonymous in forum XML
    Replies: 1
    Last Post: 07-01-2008, 05:27 AM
  2. Is the Java Sound API too complex?
    By RikMeucci in forum Java
    Replies: 2
    Last Post: 12-05-2005, 07:59 AM
  3. .NET vs. Enterprise Java: Who's Got Better Security?
    By Glen Kunene in forum Talk to the Editors
    Replies: 17
    Last Post: 03-23-2002, 01:43 AM
  4. JAVADOTNET !!!
    By Dharmesh in forum .NET
    Replies: 4
    Last Post: 10-01-2001, 04:47 PM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center