Hi Madhan,
I am facing the problem of adding special characters to the collection Database in below cases,
What do you mean by "problem", and what are "special characters"? Christian
Case-1: if the xml file size is huge(in GBs),at the time the collection Database creation tacking more time, Case-2: if the more no.of xml files are adding to the particular collection Database continuously
Example:
in Xml file <MyTag myAttribute="10" ...</MyTag>
The values are adding like the following in collection <MyTag myAttribute="A" ...</MyTag>
Sample Collection adding code :
/* This method takes the xml files list as input and process the list Create the xml collection DB, adds xml to the collection if already exists replace it */
public static void createCollection(ArrayList<String> listFiles){ ClientSession clientSession = null; String strIndexedFile=""; try { clientSession = new ClientSession("<<IP_ADDRESS>>", 1984, "<<USER>>", "<<PWD>>"); String strDbName = "Sample_Collection"; String strKeysFileLocation = "D:\TEMP\7GB_Collection_TestingTeam\Files";
String res = clientSession.execute("XQUERY db:exists('" +
strDbName + "')"); //DB existence checking if (!res.equalsIgnoreCase("true")) { clientSession.execute("CREATE DB " + strDbName); } else { clientSession.execute("OPEN " + strDbName); }
for (int i = 0; i < listFiles.size(); i++) { strIndexedFile = listFiles.get(i); String tempFlag=clientSession.execute("XQUERY db:exists('" +
strDbName + "','" + strIndexedFile + "')"); clientSession.execute("ADD " + strKeysFileLocation + File.separator + strIndexedFile); } System.out.println("InFormation:: "+clientSession.execute("INFO")); //optimizing the current opend DB using OPTIMIZE ALL command clientSession.execute("OPTIMIZE ALL"); System.out.println("InFormation:: "+clientSession.execute("INFO"));
} catch (Exception e) { System.out.println("Exception files DB Updating: " +
e.getMessage()); e.printStackTrace(); } finally { if (clientSession != null) { try { clientSession.close(); } catch (IOException ex) { ex.printStackTrace(); } } } }
Hardware Specifications of Basex Sever :
Operating System : Red Hat Enterprise Linux 64bit OS Version : Linux 2.6.32 Hard Disk : 500 GB Memory Capacity : 16 GB Ram Processor Family : Intel (R) Xeon(R) CPU E5 -2680 V2 Processor Speed : 2.80 GHz Physical Processors : 8 Virtual Processors/cores : 4 Server Version : basex 7.9 -- Thanks & Regards Madhangopal.P
basex-talk@mailman.uni-konstanz.de