To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=66271 Issue #:|66271 Summary:|Wrong example in CodeSamples.java and DevelopersGuide |(page836 adding and editing predefined Queries) Component:|Database access Version:|OOo 2.0.2 Platform:|All URL:| OS/Version:|All Status:|UNCONFIRMED Status whiteboard:| Keywords:| Resolution:| Issue type:|DEFECT Priority:|P3 Subcomponent:|none Assigned to:|dbaneedsconfirm Reported by:|stefan3
------- Additional comments from [EMAIL PROTECTED] Fri Jun 9 03:12:20 -0700 2006 ------- In the method createQuerydefinition()the last-but-one command retrieves the XStoreable interface from the XQueryDefinitionsSupplier which is wrong because the XQueryDefinitionsSupplier interface doesn't support the XStoreable interface. As a consequence the following command returns null and xStore get value null. WRONG: XStorable xStore = (XStorable)UnoRuntime.queryInterface(XStorable.class, xQuerySup); RIGHT: Get the XStoreable interface from the XOfficeDatabaseDocument to store the database document and with it the predefined Query: Object dataSource = xNameAccess.getByName( "Bibliography" ); XDocumentDataSource xDocumentDatasource = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, dataSource); XOfficeDatabaseDocument xOfficeDatabaseDocument = xDocumentDatasource.getDatabaseDocument(); XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xOfficeDatabaseDocument); //Then it's possible to store it xStorable.store(); Thanks to Frank Schönheit who helped me to solve this problem! Greets Stefan --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]