/** * Gets the connection, uses userName and password if one is set * @return * @throws XQException */ private XQConnection getConnection() throws XQException { XQConnection conn; if(StringUtils.hasText(userName)) { conn = xqDataSource.getConnection(userName,password); } else { conn = xqDataSource.getConnection(); } return conn; }
public XQJClientApp(Properties props) throws XQException { XQDataSource xqds = new BagriXQDataSource(); xqds.setProperty(ADDRESS, props.getProperty(pn_schema_address)); xqds.setProperty(SCHEMA, props.getProperty(pn_schema_name)); xqds.setProperty(USER, props.getProperty(pn_schema_user)); xqds.setProperty(PASSWORD, props.getProperty(pn_schema_password)); xqds.setProperty(XQ_PROCESSOR, "com.bagri.xquery.saxon.XQProcessorClient"); xqds.setProperty(XDM_REPOSITORY, "com.bagri.client.hazelcast.impl.SchemaRepositoryImpl"); xqConn = xqds.getConnection(); }
protected static XQDataSource initDataSource() throws XQException { XQDataSource xqds = new BagriXQDataSource(); xqds.setProperty(ADDRESS, System.getProperty(pn_schema_address)); xqds.setProperty(SCHEMA, System.getProperty(pn_schema_name)); xqds.setProperty(USER, System.getProperty(pn_schema_user)); xqds.setProperty(PASSWORD, System.getProperty(pn_schema_password)); xqds.setProperty(XQ_PROCESSOR, "com.bagri.xquery.saxon.XQProcessorClient"); xqds.setProperty(XDM_REPOSITORY, "com.bagri.client.hazelcast.impl.SchemaRepositoryImpl"); String value = System.getProperty(pn_client_loginTimeout); if (value != null) { xqds.setProperty(pn_client_loginTimeout, value); } value = System.getProperty(pn_client_bufferSize); if (value != null) { xqds.setProperty(pn_client_bufferSize, value); } value = System.getProperty(pn_client_connectAttempts); if (value != null) { xqds.setProperty(pn_client_connectAttempts, value); } return xqds; }
@Override protected TPoXQueryManagerTest initialValue() { try { XQConnection xqc = xqds.getConnection(); SchemaRepository xdm = ((BagriXQDataFactory) xqc).getProcessor().getRepository(); TPoXQueryManagerTest xqmt = new TPoXQueryManagerTest(xdm); logger.info("initialValue.exit; XDM: {}", xdm); return xqmt; } catch (XQException ex) { logger.error("", ex); return null; } }
private void setupXQConnection(ApplicationContext ctx) throws XQException { XQDataSource xqds = ctx.getBean("xqDataSource", XQDataSource.class); String username = srvUser.getCurrentUser(); String password = srvUser.getUserPassword(username); if (password == null) { throw new XQException("no credentials found for user " + username); } XQConnection xqConn = xqds.getConnection(username, password); QueryManagement qMgr = ctx.getBean("queryManager", QueryManagement.class); qMgr.setXQConnection(xqConn); }
@Override protected void doInitialise() throws InitialisationException { if (xquery != null && xqueryFile != null) { throw new InitialisationException(XmlMessages.canOnlySetFileOrXQuery(), this); } try { if (xqueryFile != null) { xquery = IOUtils.getResourceAsString(xqueryFile, getClass()); } if (configuration == null) { configuration = new Configuration(); } XQDataSource ds = new SaxonXQDataSource(configuration); connection = ds.getConnection(); transformerPool.addObject(); } catch (Throwable te) { throw new InitialisationException(te, this); } }
@Override protected XQConnection initialValue() { try { XQConnection xqc = xqds.getConnection(); setProperty(((BagriXQDataFactory) xqc).getProcessor().getProperties(), pn_client_fetchSize, null); setProperty(((BagriXQDataFactory) xqc).getProcessor().getProperties(), pn_client_fetchType, null); setProperty(((BagriXQDataFactory) xqc).getProcessor().getProperties(), pn_client_submitTo, null); setProperty(((BagriXQDataFactory) xqc).getProcessor().getProperties(), pn_client_ownerParam, null); logger.info("initialValue.exit; XQC: {}", xqc); return xqc; } catch (XQException ex) { logger.error("", ex); return null; } } };
XQConnection xqconn = xqds.getConnection();
XQConnection xqconn = xqds.getConnection();
XQConnection xqconn = xqds.getConnection();