Skip to Content
avatar image
Former Member

DataProvider get Custom SQL Query via Java SDK

Dear all,

I'm trying to retrieve custom SQL Script queries from Webi documents using the java SDK.
Already tried to retrieve it using the RESTful WebService but not successfully (RESTful only working for standard generating script)

Please see the code here below. For me, the code is not retrieving anything, SQL Viewing not supported (process always going into the "else" condition while testing sqlDataProv.isSupported(DataProviderFeature.VIEW_SQL) ). I think it's because WebI documents have been created in a former version of Web Intelligence application.

Have you got any idea on how to get the custom SQL scripts using Java SDK?

Thanks in advance for your support.

Regards.

if (dataProvider instanceof SQLDataProvider){
							SQLDataProvider sqlDataProv = (SQLDataProvider) dataProvider;
							
							
							if ( sqlDataProv.isSupported(DataProviderFeature.VIEW_SQL) ) {
	
								ArrayList<TreeNode> nodes = getListOfTreeNodes(sqlDataProv.getSQLContainer(), true);
								for (TreeNode node : nodes) {
									if (node instanceof SQLSelectStatement) {
										SQLSelectStatement query = (SQLSelectStatement)node;
	
										fWriterOutputLog = "SQL Retrieved" + NEW_LINE_SEPARATOR
												+ query.getSQL() + NEW_LINE_SEPARATOR;
										brOutputLog.append(fWriterOutputLog);
										
										sqlQuery += query.getSQL() + NEW_LINE_SEPARATOR;
										
									}
								}
							}
							else {
								if ( verboseExec == 1){
									fWriterOutputLog = "DataProvider " + dataProvider.getID() 
													 + " doesn't support viewing its SQL with CMS access."
													 + NEW_LINE_SEPARATOR;
									brOutputLog.append(fWriterOutputLog);
								}
							}
	
						}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 07, 2017 at 09:09 PM

    What version of BOBJ are you using? If it's 4.0 or newer, you will have to use the Web Intelligence RESTful Web Services SDK to get this information. It looks like you're using Rebean, which has been deprecated in the newer versions.

    -Dell

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2017 at 09:34 AM

    Dear all,

    Any ideas?

    Regards,

    Benjamin

    Add comment
    10|10000 characters needed characters exceeded