diff options
Diffstat (limited to 'connectivity/qa/connectivity/tools/DataSource.java')
-rw-r--r-- | connectivity/qa/connectivity/tools/DataSource.java | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/connectivity/qa/connectivity/tools/DataSource.java b/connectivity/qa/connectivity/tools/DataSource.java index 221ada3cb487..5c06f7d69622 100644 --- a/connectivity/qa/connectivity/tools/DataSource.java +++ b/connectivity/qa/connectivity/tools/DataSource.java @@ -69,6 +69,14 @@ public class DataSource return m_dataSource; } + /** + * retrieves the data source's settings + */ + public XPropertySet geSettings() + { + return UnoRuntime.queryInterface( XPropertySet.class, impl_getPropertyValue( "Settings" ) ); + } + /** creates a query with a given name and SQL command */ public void createQuery(final String _name, final String _sqlCommand) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException @@ -121,25 +129,35 @@ public class DataSource return suppQueries.getQueryDefinitions(); } - /** returns the name of the data source - * - * If a data source is registered at the database context, the name is the registration - * name. Otherwise, its the URL which the respective database document is based on. - * - * Note that the above definition is from the UNO API, not from this wrapper here. + /** + * retrieves a property value from the data source + * @param i_propertyName + * the name of the property whose value is to be returned. */ - public String getName() + private Object impl_getPropertyValue( final String i_propertyName ) { - String name = null; + Object propertyValue = null; try { final XPropertySet dataSourceProps = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource ); - name = (String) dataSourceProps.getPropertyValue("Name"); + propertyValue = dataSourceProps.getPropertyValue( i_propertyName ); } catch (Exception ex) { Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex); } - return name; + return propertyValue; + } + + /** returns the name of the data source + * + * If a data source is registered at the database context, the name is the registration + * name. Otherwise, its the URL which the respective database document is based on. + * + * Note that the above definition is from the UNO API, not from this wrapper here. + */ + public String getName() + { + return (String)impl_getPropertyValue( "Name" ); } }; |