Hello,
  I'm using "net.xqj.basex.BaseXXQDataSource" to connect to a BaseX servlet running in Tomcat but it doesn't connect.

  I can run the following command :
http://localhost:8080/BaseX721/rest?command=info

Main Options DBPATH: C:\Apache Tomcat 6.0.20\webapps\BaseX721\\data DEBUG: false EVENTPORT: 1985 HOST: localhost HTTPPATH: C:\Apache Tomcat 6.0.20\webapps\BaseX721\ HTTPPORT: 8984 KEEPALIVE: 0 LANG: English LANGKEYS: false NONPROXYHOSTS: PARALLEL: 8 PORT: 1984 PROXYHOST: PROXYPORT: 80 REPOPATH: C:\Apache Tomcat 6.0.20\webapps\BaseX721\\repo SERVERHOST: SERVERPORT: 1984 STOPPORT: 8985 TIMEOUT: 0

But when I run :
    private static final String DRIVER = "net.xqj.basex.BaseXXQDataSource";
   XQDataSource xqds = (XQDataSource) Class.forName(DRIVER).newInstance();
    xqds.setProperty("serverName", "localhost");
    xqds.setProperty("port", "1985");

I get :
Exception in thread "main" javax.xml.xquery.XQException:
  XQJNC001 - Connection refused: connect
  Root Cause:
  java.net.ConnectException: Connection refused: connect

Is this even possible?

Any pointers will be greatly appreciated.
Thanks,
Anupam