Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gaurav_g
Starting Member
1 Post |
Posted - 2010-05-05 : 16:58:05
|
Hi All,I am working on Microsoft SQL Server 2008 which is installed on Microsoft Windows XP professional 2002.I have created a cube on adventureworks database as described in the link :[url]http://www.accelebrate.com/sql_training/ssas_2008_tutorial.htm[/url]Now i want to access the cube data using java code , for which i referred to link : [url]http://www.matthewgodding.com/articles/2010/2/27/getting-data-from-sql-analysis-services-using-java-and-olap4.html[/url]according to which i need to set HTTP access, for which i referred to link :[url]http://technet.microsoft.com/hi-in/library/cc917712(en-us).aspx[/url]Question1- Now, I am not sure whether i have successfully finished the HTTP access configuration part as when i try to acces the following url:http://localhost/olap/msmdpump.dllI am getting following error:"HTTP 500 - Internal server errorInternet Explorer " However, I am not getting any connection error when i execute the following java code on eclipse :import java.sql.DriverManager;import java.sql.SQLException;import java.util.List;import org.olap4j.* ; import org.apache.xerces.parsers.DOMParser ; public class test2 {public static void main(String[] args) { try { Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } try { OlapConnection con = (OlapConnection)DriverManager.getConnection("jdbc:xmla:Server=http://localhost/olap/msmdpump.dll;"); OlapWrapper wrapper = (OlapWrapper) con; OlapConnection olapConnection = (OlapConnection) wrapper.unwrap(OlapConnection.class); OlapStatement stmt = olapConnection.createStatement(); CellSet cellSet = stmt.executeOlapQuery("select {[Dim Account].[Account Description].[Account Description]}ON Columns, {[Measures].[Amount]} ON Rows from [financecube];"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }} however, i am getting following error :Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at org.olap4j.driver.xmla.DeferredNamedListImpl.get(DeferredNamedListImpl.java:86) at org.olap4j.driver.xmla.DeferredNamedListImpl.get(DeferredNamedListImpl.java:43) at org.olap4j.driver.xmla.XmlaOlap4jConnection.getCatalog(XmlaOlap4jConnection.java:373) at org.olap4j.driver.xmla.XmlaOlap4jStatement.executeOlapQuery(XmlaOlap4jStatement.java:257) at test2.main(test2.java:26) Question 2- The reason for above error and solution.Any help in this regard would be grateful.Thanks in advance,Gauravgaurav |
|
|
|
|