How to create xml file dynamically in java and store into BaseX database 'db'. That means it shouldn't not be created into my disk(my system) but it should be directly created(store) into database 'db' ?????
Please give me some better solution.
Hi Manish,
You might want to take a look at our java examples here : https://docs.basex.org/wiki/Java_Examples
So to simply execute an XQuery and using db:add() (see https://docs.basex.org/wiki/Database_Module#db:add) to add to the database would look something like that:
Context context = new Context(); String query = "db:add("your-database", <xml>here goes your xml</xml>, "myfile.xml") QueryProcessor proc = new QueryProcessor(query, context); proc.execute(); proc.close(); context.close();
the second argument of db:add() is an item(), so you can also dynamically generate an XML element here.
Cheers, Dirk
On 29/07/14 14:46, manish payasi wrote:
How to create xml file dynamically in java and store into BaseX database 'db'. That means it shouldn't not be created into my disk(my system) but it should be directly created(store) into database 'db' ?????
Please give me some better solution.
basex-talk@mailman.uni-konstanz.de