***  This package is subject to change.  ***

Note:
Extension of the classes in this package is prohibited unless otherwise documented. Similarly, extension or implementation of the interfaces in this package is prohibited except as documented.

Package com.sas.storage.flattened.sasmdx

Provides a set of classes for accessing OLAP data from the SAS OLAP Server with a flattened view.

See:
          Description

Class Summary
FlattenResultSet This resultset is olap data represented in the java.sql.resultset form.
FlattenResultSetMetadata FlattenResultSetMetadata class surfaces the column information for the Flatten ResultSet.
 

Package com.sas.storage.flattened.sasmdx Description

Provides a set of classes for accessing OLAP data from the SAS OLAP Server with a flattened view.

OVERVIEW

This package provides a set of classes which can be used to execute query and return the results in form of javax.sql.ResultSet. This implementation provides access to the SAS OLAP Server and can be used to execute data queries, primarily MDX, and read the results of these queries in the flattened form. 

EXAMPLES

Data Access

Execute a MDX Query and Print the Results

try {

// Create instance of OLAPDataSet and execute the MDX Query
String queryStatement = "sample MDX Query";
FlattenResultSet frs = new FlattenResultSet("hostname", port, "username", "password", queryStatement);

// Get the ResultSet Metadata
FlattenResultSetMetadata frsm = frs.getMetadata();
int columnCount = frsm.getColumnCount();

System.out.println(
"--Column information--");
for (int i=1; i <= columnCount; i++)
{
    System.out.println("Column Num: " +i);
    System.out.println(" Name: " + frsm.getColumnName(i));
    System.out.println(" Label:"+frsm.getColumnLabel(i));
    System.out.println(" TypeName:"+frsm.getColumnTypeName(i));
}

// Print formatted Cell Data
System.out.println("--formatted cell values--");

//position the cursor to before the first row
frs.absolute(0);
while (frs.next())
{
      System.out.println("Row : "+frs.getRow());
   for (int i=1; i <= columnCount; i++)
       System.out.print(" " + frs.getString(i));
   System.out.println();

}
}
catch (OLAPException ex) {
            System.out.println(ex.getMessage());
            ex.printStackTrace();
}

For More Information

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

 

 


***  This package is subject to change.  ***

Note:
Extension of the classes in this package is prohibited unless otherwise documented. Similarly, extension or implementation of the interfaces in this package is prohibited except as documented.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.