Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Problem:Connecting to Oracle10g SampleData

  1. #1

    Default Problem:Connecting to Oracle10g SampleData

    Hi,
    I am using the pentaho reporting engine classic-0.8.9.2 and am trying to connect to Oracle 10g in order to access the sampledatabase to generate a report.

    The java code that I am suing is:

    JFreeReportBoot.getInstance().start();
    JFreeReport report= new JFreeReport();
    DriverConnectionProvider provider = new DriverConnectionProvider();
    provider.setDriver("oracle.jdbc.OracleDriver");
    provider.setProperty("user","sampledata");
    provider.setProperty("pass","password");

    provider.setUrl("jdbcracle:thin:@ps0066.persistent.co.in:1521entaho");

    SQLReportDataFactory dataFactory = new SQLReportDataFactory(provider);

    dataFactory.setQuery("default",
    "SELECT DISTINCT REGION FROM QUADRANT_ACTUALS;");

    dataFactory.setQuery("actuals-by-region",
    "SELECT * FROM QUADRANT_ACTUALS WHERE
    REGION=${REGION}");
    report.setDataFactory(dataFactory);
    final PreviewDialog frame = new PreviewDialog(report);
    frame.pack();
    RefineryUtilities.positionFrameRandomly(frame);
    frame.setVisible(true);

    However, I am getting the following error:

    org.jfree.report.ReportProcessingException
    : Unable to initialize the report
    at org.jfree.report.layout.output.AbstractReportProcessor.prepareReportProcessing(
    AbstractReportProcessor.java:472)
    at org.jfree.report.modules.output.pageable.graphics.PrintReportProcessor.getNumberOfPages(
    PrintReportProcessor.java:88)
    at org.jfree.report.modules.gui.base.PreviewPane$RepaginationRunnable.run(
    PreviewPane.java:252)
    at org.jfree.report.util.Worker.run(
    Worker.java:156)

    ParentException
    :

    org.jfree.report.ReportDataFactoryException
    : Failed at query: SELECT DISTINCT REGION FROM QUADRANT_ACTUALS;
    at org.jfree.report.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.queryData(
    SimpleSQLReportDataFactory.java:215)
    at org.jfree.report.modules.misc.datafactory.sql.SQLReportDataFactory.queryData(
    SQLReportDataFactory.java:95)
    at org.jfree.report.states.CachingDataFactory.queryData(
    CachingDataFactory.java:253)
    at org.jfree.report.states.datarow.ReportDataRow.createDataRow(
    ReportDataRow.java:89)
    at org.jfree.report.states.datarow.DefaultFlowController.performQuery(
    DefaultFlowController.java:176)
    at org.jfree.report.states.process.ProcessState.<init>(
    ProcessState.java:115)
    at org.jfree.report.layout.output.AbstractReportProcessor.prepareReportProcessing(
    AbstractReportProcessor.java:388)
    at org.jfree.report.modules.output.pageable.graphics.PrintReportProcessor.getNumberOfPages(
    PrintReportProcessor.java:88)
    at org.jfree.report.modules.gui.base.PreviewPane$RepaginationRunnable.run(
    PreviewPane.java:252)
    at org.jfree.report.util.Worker.run(
    Worker.java:156)

    ParentException
    :

    java.sql.SQLException
    : invalid arguments in call
    at oracle.jdbc.driver.DatabaseError.throwSqlException(
    DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(
    DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(
    DatabaseError.java:208)
    at oracle.jdbc.driver.T4CConnection.logon(
    T4CConnection.java:236)
    at oracle.jdbc.driver.PhysicalConnection.<init>(
    PhysicalConnection.java:439)
    at oracle.jdbc.driver.T4CConnection.<init>(
    T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(
    T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(
    OracleDriver.java:801)
    at java.sql.DriverManager.getConnection(
    DriverManager.java:525)
    at java.sql.DriverManager.getConnection(
    DriverManager.java:140)
    at org.jfree.report.modules.misc.datafactory.sql.DriverConnectionProvider.getConnection(
    DriverConnectionProvider.java:102)
    at org.jfree.report.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.getConnection(
    SimpleSQLReportDataFactory.java:121)
    at org.jfree.report.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.queryData(
    SimpleSQLReportDataFactory.java:179)
    at org.jfree.report.modules.misc.datafactory.sql.SQLReportDataFactory.queryData(
    SQLReportDataFactory.java:95)
    at org.jfree.report.states.CachingDataFactory.queryData(
    CachingDataFactory.java:253)
    at org.jfree.report.states.datarow.ReportDataRow.createDataRow(
    ReportDataRow.java:89)
    at org.jfree.report.states.datarow.DefaultFlowController.performQuery(
    DefaultFlowController.java:176)
    at org.jfree.report.states.process.ProcessState.<init>(
    ProcessState.java:115)
    at org.jfree.report.layout.output.AbstractReportProcessor.prepareReportProcessing(
    AbstractReportProcessor.java:388)
    at org.jfree.report.modules.output.pageable.graphics.PrintReportProcessor.getNumberOfPages(
    PrintReportProcessor.java:88)
    at org.jfree.report.modules.gui.base.PreviewPane$RepaginationRunnable.run(
    PreviewPane.java:252)
    at org.jfree.report.util.Worker.run(
    Worker.java:156)

    DEBUG: Pagination: false No. 0

    I have given all valid connection parameters and am am able to get the data, when I query the database from SQLPLUS.

    Please help me with this.

    Thanking you, in advance.

    Regards,
    Arijit Chatterjee

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Given the stacktrace below, your SQL statement is not even executed. The whole process crashes when trying to get a connection to the database. So either your connection string, your username or password are invalid. Or it is something weird inside Oracle. As I successfully avoided using Oracle in the past, I cant even guess what might be wrong there.

    Maybe someone with more Oracle experience can ..
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Feb 2008
    Posts
    1

    Default Oracle JDBC Driver Properties

    Hi had a similar problem to the one indicated.

    After some scratching around I noticed that the driver properties for the Oracle JDBC driver are "user" and "password" (not "pass" as specified in the code sample).

    This code connects correctly to my Oracle 10g data source:

    DriverConnectionProvider provider = new DriverConnectionProvider();
    provider.setDriver("oracle.jdbc.OracleDriver");
    provider.setProperty("user", "<user>");
    provider.setProperty("password", "<password>");
    provider.setUrl("jdbcracle:thin:@<server>:1521:<database>");

    Hope this helps!

    Cheers,
    Philip.

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    As usual when dealing with databases, there is no commonly agreed standard on what properties should be used how.

    After all, databases have been invented in the 1960s and (roughly) 50 years are simply not enough for all players to settle on a common agreement or common open and interoperable standards.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.