XML JDBC Driver

Hello all!

I need a JDBC to connect XML files. Googling the network, I’ve found StelsXML … but without success for servoy needs. This driver doesn’t support primary keys ( or at least I don’t know how to implement pks in this driver ) and Servoy need them.

Anybody knows any Servoy compatible XML JDBC driver?

Greetings. Roberto Blasco.

I don’t know if you can get the sources from this driver, but you would have to modify them so that they take into account an attribute of a node in your xml and declare it as the pk.

If the driver doesn’t report PK’s, then you can always set the Row Identifier column(s) yourself through the Table Editor in Servoy Developer, so Servoy knows which (set of column(s) uniquely identifies a row.

Paul

Thanks a lot @Patrick, @Paul.

I’ve mailed J-Stels Software and this is the answer, if anybody wants to use it with Servoy.

Hello,

We are going to release new version 2.0 of StelsXML in the nearest time.

What’s new:

  1. The driver is based on the new SQL engine - open-source H2 database (http://www.h2database.com/html/main.html). So potentially the driver will able to support all functionality of H2.
  2. You can use more complete SQL ANSI syntax and also “CREATE INDEX” to create indexes.
  3. You can use plenty of functions supported by H2 including user-defined functions (http://www.h2database.com/html/functions.html)

Some important notes:

a) The class name of the driver in version 2.0 - jstels.jdbc.xml.XMLDriver2
b) The properties “ReadOnlySubMode”, “maxRecordsInMemoryPerTable” and “maxSwapStringSize” are now deprecated.
c) If you are using the swapping mode (caching = false), it is recommended to use the property “tempPath” to set a directory where temporary files will be created.

How to define a primary key:

You should define primary key in a table specification, e.g.:

In the example above we have defined a primary key for columns “prodid” and “regionid” and unique index for “minprice” by using the attribute “constraint”.

P.S. Version 2.0 is attached. The full documentation for version 2.0 will be available soon with an official release.

xmldriver.jar (1.59 MB)