Thank you for the reply Christian,
I 've not tried the examples in the [1], but the ones I am using are identical. code snippet: Class cl = Class.forName("org.basex.api.xmldb.BXDatabase"); Database database = (Database) cl.newInstance(); DatabaseManager.registerDatabase(database); DatabaseManager.getCollection("xmldb:basex://<theserverip>:1984/wcs-collection", "admin", "admin") //error in this line
I 've just tried the XQJ try { XQDataSource xqjd = new BaseXXQDataSource(); xqjd.setProperty("serverName", "http://<theserverip>:1984/wcs-collection/"); xqjd.setProperty("port", "1984"); XQConnection xqjc = xqjd.getConnection("admin", "admin"); } catch (XQException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } and I have an java.net.UnknownHostException.
Regards Yannis
On 01/14/2014 02:23 PM, Christian Grün wrote:
Hi Ioannis,
I am trying to connect to a baseX (remote) server through xmldb-api following the examples in the git-hub but it fails giving Invalid Uri error.
Could you please provide us with a little code snippet? Do the examples work that are linked from our examples page [1]?
Best, Christian
PS: We tend to deprecate the use of the XML:DB API, because both the spec and our driver has not been updated for a while. The XQJ API is probably the more up-to-date choice.
[1] http://docs.basex.org/wiki/Java_Examples
I can access the database through REST using the following url: http://<serverip>:8181/BaseX772/rest/wcs-collection/ but I cannot connect using the xmldb url xmldb:basex://<serverip>:1984/wcs-collection or xmldb:basex://<serverip>:1984/ or xmldb:basex://<serverip>:1984/rest or using the 8181 port.
Regards Yannis
MSc Student at the University of Athens, Greece _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk