#27 New class: SQLDatasetProducer

open
nobody
Examples (3)
5
2013-01-13
2003-07-30
Matthew Self
No

The attached ZIP file contains the source for a useful
data producer that I wrote that lets you create charts
from SQL queries using the standard JSTL SQL tags.

Here is the contents of the README file:

SQLDatasetProducer
------------------

This package contains the class SQLDatasetProducer,
which enables you to generate
a Cewolf chart from a JDBC data source using JSP tags
without writing any Java code
or scriptlets.

After creating a Result object with the standard JSTL
SQL tags, create a
SQLDatasetProducer bean and set the result property to
be the Result object.

<sql:query var="result">
  select series, category, value from ...

where ...
</sql:query>

<jsp:useBean id="sqlproducer"

class="de.laures.cewolf.dp.SQLDatasetProducer" />
<c:set target="${sqlproducer}"
property="result" value="${result}" />
<c:set target="${sqlproducer}"
property="type" value="category" />
<c:set target="${sqlproducer}"
property="format" value="normal" />

<cewolf:chart id="chart" type="verticalbar">
  <cewolf:data>
    <cewolf:producer id="sqlproducer" />
  </cewolf:data>
</cewolf:chart>

<cewolf:img chartid="chart" renderer="/cewolf"

width="300" height="200" />

The enclosed JSP file, SQLProducerTest.jsp,
demonstrates all of the supported result types
("pie", "category", "xy", "timeseries") and formats
("normal", "crosstab").

The static HTML file, SQLProducerTest.html, shows
what the output of the test will look like
once you compile and install SQLDatasetProducer.java
and create an appropriate SQL data source.

\--Matthew Self \(July 30, 2003\)

Discussion

  • Matthew Self
    Matthew Self
    2003-07-31

    Logged In: YES
    user_id=823677

    There was a problem with absolute paths in the sample HTML
    file included. I have uploaded a corrected version.

     
  • Matthew Self
    Matthew Self
    2003-07-31

    SQLDatasetProducer.zip (corrected)

     
  • Luis Vidrio
    Luis Vidrio
    2003-10-14

    Logged In: YES
    user_id=884480

    Please tell me Where i can configure my DB?