2 Replies Latest reply: Aug 29, 2012 10:29 AM by rp0428 RSS

    JDBC with XML files.


      Hello guys !

      I have a bit of situation on which i really can't find any answer on google :x: so i'm turning to you guys... so here it is:

      I would like to open XML files (.xml) on computer with a JDBC driver (instead of new File() function). So actually i want same functionality as Derby Enbedded Driver does, but instead of opening .db files i want to open .xml files. I'm using XML files for saving data like databases are - with tables, schemas and stuff. I can write something like my own JDBC driver, or extend from some driver that already does something like that.. I would like to make something, so i could connect like this:

      String url = "jdbc:mydriver:D:\\username\nameOfFile.xml"; Class.forName ("com.mydriver.jdbc.Driver").newInstance (); conn = DriverManager.getConnection (url); System.out.println ("Database connection established");

      Once i'm connected with driver, i would also like to use SQL statements for my XML file database.
      I hope i was clear enough so you have idea what i'm trying to achieve here.

      Any tips, help would be much appreciated !


        • 1. Re: JDBC with XML files.
          Crossposted - http://www.java-forums.org/xml/62573-xml-files-jdbc-driver.html
          • 2. Re: JDBC with XML files.
            I can write something like my own JDBC driver
            You will have to write your own driver. I am not aware of any existing drivers that will do what you want to do. The closest analogy is the Microsoft ODBC text driver where you create an INI file that describes the metadata in a delimited file.