/** creates a query with a given name and SQL command
*/ publicvoid createQuery(final String _name, final String _sqlCommand) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{
createQuery(_name, _sqlCommand, true);
}
/** creates a query with a given name, SQL command, and EscapeProcessing flag
*/ publicvoid createQuery(final String _name, final String _sqlCommand, finalboolean _escapeProcessing) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
{ final XSingleServiceFactory queryDefsFac = UnoRuntime.queryInterface( XSingleServiceFactory.class, getQueryDefinitions() );
XPropertySet queryDef = null; try
{
queryDef = UnoRuntime.queryInterface( XPropertySet.class, queryDefsFac.createInstance() );
queryDef.setPropertyValue("Command", _sqlCommand);
queryDef.setPropertyValue("EscapeProcessing", Boolean.valueOf(_escapeProcessing));
} catch (com.sun.star.uno.Exception e)
{
e.printStackTrace(System.err);
}
/** provides the query definition with the given name
*/ public QueryDefinition getQueryDefinition(final String _name) throws NoSuchElementException
{ final XNameAccess allDefs = getQueryDefinitions(); try
{ returnnew QueryDefinition( UnoRuntime.queryInterface( XPropertySet.class, allDefs.getByName( _name) ) );
} catch (WrappedTargetException e)
{
} thrownew NoSuchElementException();
}
/** provides the container of query definitions of the data source
*/ private XNameAccess getQueryDefinitions()
{ final XQueryDefinitionsSupplier suppQueries = UnoRuntime.queryInterface(
XQueryDefinitionsSupplier.class, m_dataSource); return suppQueries.getQueryDefinitions();
}
/** returns the name of the data source * *Ifadatasourceisregisteredatthedatabasecontext,thenameistheregistration *name.Otherwise,it'stheURLwhichtherespectivedatabasedocumentisbasedon. * *NotethattheabovedefinitionisfromtheUNOAPI,notfromthiswrapperhere.
*/ public String getName()
{ return (String)impl_getPropertyValue( "Name" );
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.