Package org.pentaho.commons.connection

Examples of org.pentaho.commons.connection.IPentahoConnection.executeQuery()


      connection =
          PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName, getSession(), this );
    }
    String query = ReportParameterUtility.setupParametersForActionSequence( reportSpec.getQuery() );
    query = setupQueryParameters( query );
    IPentahoResultSet res = connection.executeQuery( query );
    return res;
  }

  public String setupQueryParameters( String query ) {
    Set inputNames = getInputNames();
View Full Code Here


      connection =
          PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName, getSession(), this );
    }
    String query = ReportParameterUtility.setupParametersForActionSequence( reportSpec.getQuery() );
    query = setupQueryParameters( query );
    IPentahoResultSet res = connection.executeQuery( query );
    return res;
  }

  @Override
  protected boolean executeAction() {
View Full Code Here

                      userSession, logger );

              try {
                query =
                    TemplateUtil.applyTemplate( query, TemplateUtil.parametersToProperties( parameterProvider ), null );
                IPentahoResultSet results = connection.executeQuery( query );
                chartComponent.setValues( results );
              } finally {
                boolean ignored = true;
              }
View Full Code Here

    IPentahoConnection connection =
        PentahoConnectionFactory.getConnection( IPentahoConnection.MDX_DATASOURCE, mdxProperties, session, this );
    // @TODO Need to know how to use this getConnection method. Where does this property name comes from

    try {
      IPentahoResultSet results = connection.executeQuery( "select * from DEPARTMENT_MANAGERS" ); //$NON-NLS-1$
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = 0; row < columnHeaders.length; row++ ) {
        for ( int col = 0; col < columnHeaders[0].length; col++ ) {
          outputStream.write( columnHeaders[row][col].toString().getBytes() );
          outputStream.write( ",".getBytes() ); //$NON-NLS-1$
View Full Code Here

              IPentahoConnection.MDX_DATASOURCE,
              "jdbc:hsqldb:hsql://localhost:9001/sampledata; Catalog=" + file.toURI().toString(), "mondrian", "sa", "",
              session, this ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

    try {
      IPentahoResultSet results = connection.executeQuery( "select * from DEPARTMENT_MANAGERS" ); //$NON-NLS-1$
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = 0; row < columnHeaders.length; row++ ) {
        for ( int col = 0; col < columnHeaders[0].length; col++ ) {
          outputStream.write( columnHeaders[row][col].toString().getBytes() );
          outputStream.write( ",".getBytes() ); //$NON-NLS-1$
View Full Code Here

              session, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    String query =
        "select {[Measures].[Actual], [Measures].[Budget]} on rows, {[Region].[All Regions]} ON columns from [Quadrant Analysis] WHERE ([Positions].[All Positions])"; //$NON-NLS-1$

    try {
      IPentahoResultSet results = connection.executeQuery( query );
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = columnHeaders.length - 1; row >= 0; row-- ) {
        for ( int col = 0; col < columnHeaders[row].length; col++ ) {
          outputStream.write( ( columnHeaders[row][col] + "\t" ).getBytes() ); //$NON-NLS-1$
        }
View Full Code Here

            "jdbc:hsqldb:hsql://localhost:9001/sampledata; Catalog=" + catalog, "mondrian", "sa", "", session, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    String query =
        "select {[Measures].[Actual], [Measures].[Budget]} on rows, {[Region].[All Regions]} ON columns from [Quadrant Analysis] WHERE ([Positions].[All Positions])"; //$NON-NLS-1$

    try {
      IPentahoResultSet results = connection.executeQuery( query );
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = columnHeaders.length - 1; row >= 0; row-- ) {
        for ( int col = 0; col < columnHeaders[row].length; col++ ) {
          outputStream.write( ( columnHeaders[row][col] + "\t" ).getBytes() ); //$NON-NLS-1$
        }
View Full Code Here

      IPentahoConnection connection =
          PentahoConnectionFactory.getConnection( IPentahoConnection.XML_DATASOURCE, session, this );
      String query =
          "doc(\"" + PentahoSystem.getApplicationContext().getSolutionPath( "samples/datasources/books.xml" ) + "\")/bookstore/book"; //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
      query = query.replace( '\\', '/' );
      IPentahoResultSet results = connection.executeQuery( query );
      assertNotNull( results );
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = 0; row < columnHeaders.length; row++ ) {
        for ( int col = 0; col < columnHeaders[0].length; col++ ) {
          outputStream.write( columnHeaders[row][col].toString().getBytes() );
View Full Code Here

    IPentahoConnection connection =
        PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, "SampleData", userSession, this ); //$NON-NLS-1$
    try {
      String query = "select department, actual, budget, variance from QUADRANT_ACTUALS"; //$NON-NLS-1$

      IPentahoResultSet results = connection.executeQuery( query );
      try {

        barChart.setValues( results );
        barChart.validate( userSession, null );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.