I am trying to connect to MarkLogic with JAVA using XCC.
URI uri = new URI("xcc://admin:admin123@localhost:8011/Documents");
ContentSource contentSource = ContentSourceFactory.newContentSource(uri);
Session session = contentSource.newSession();
Request request = session.newAdhocQuery("\"Hello World\"");
ResultSequence rs = session.submitRequest(request);
System.out.println(rs.asString());
session.close();
I get the below exception.
Exception in thread "main" com.marklogic.xcc.exceptions.ServerConnectionException: Premature End-Of-Stream on flush. Server connection lost?
The error seems to because of XDBC server congiration. I am not able to figure out what I am doing wrong here.
Few of the XDBC parameters are,
authentication = basic,
threads = 100,
timeout = 1000
keep alive time count = 5