XMLimport is part of Fredy's SQLAdmin IT has been done, to import a XML-File into a database table. It needs minimally two things to be used correctly: 1. you need to provide a ControlFile so it knows, what to import and how 2. you need a XML-file containing the data you want to import. The DataFile in fact needs to have repeating entries with the same name representing one single database entry. This is called here the 'DataSet' and must have a name. Much more important is the XML-description or controlfile, which leads the whole import-process. With this file you control what is done while the import. You provide these values: - shall the table be created - shall the content of the existing table be cleared before import starts - you can also provide the JDBC-Driver and the connection URL within this file. if these values are given, dont't add them on the commandline - shall the import be aborted on an error - the name of the table to create or use - the name of the dataset within the data XML file - describe every single attribute to be imported out of a dataset this is the part 'field' Tabledescription follows here the JDBC-Driver to use (optional) org.apache.derby.jdbc.EmbeddedDriver the connection URL, you need to provide this, if you've provided the JDBC-Driver jdbc:derby:H:\Databases\Derby\testdb if you set this switch to yes, every error will make the import interrupt yes|no the Element-Name containing the dataset to be imported name of the dataset the name of the table the data are going into enter the tablename her if you say 'yes' the table will be created, yes | no if you say yes, the first statement executed will be delete from [tablename] yes|no the description of every single attribut used by the import is described here the name of the xml element below is the description of the DB-table fieldname fieldtype fieldlength add as many options as you like, options are added with a space to the create statement options options
So, it might look like that: org.apache.derby.jdbc.EmbeddedDriverjdbc:derby:H:\Databases\Derby\testdbyesUsersusers2noyes AccountName login VARCHAR 10 not null givenname firstname VARCHAR 100 sn lastname VARCHAR 100 displayName displayname VARCHAR 200 Birthday dateofBirth date