Hi,
i'm actually using JFreeServlet(to generate a xy chart) and i've a little problem with my sql query:
if i use this, no problem:
Select Data1, Data2 From Table
But when i try that:
Select Data1, avg(Data2) From Table Group By Data1
i get a ArrayIndexOutOfBoundsException
How can i correct this?
JFreeServlet and SQL
Re: JFreeServlet and SQL
Elder
I tried the following sql at http://coyote.aad.gov.au/JFreeServlet/example2.html:
set_code, avg(record_count) as Track
from marine.summary_track
group by set_code
Things seemed fine.
A couple of questions:
1. Are you using the downloaded war/jar or from CVS?
2. What DB are you using
3. Can you post the full stack trace
4. Can you send the results of the query
Select Data1, avg(Data2) From Table Group By Data1
Bryan
I tried the following sql at http://coyote.aad.gov.au/JFreeServlet/example2.html:
set_code, avg(record_count) as Track
from marine.summary_track
group by set_code
Things seemed fine.
A couple of questions:
1. Are you using the downloaded war/jar or from CVS?
2. What DB are you using
3. Can you post the full stack trace
4. Can you send the results of the query
Select Data1, avg(Data2) From Table Group By Data1
Bryan
Re: JFreeServlet and SQL
ok, i think i've found my real problem, but i've still not the solution:
My Data1 is in fact the concatenation of two columns
Select Data1_1||Data1_2, avg(Data2) From Table Group By Data1_1||Data1_2
I'm using sorces from CVS, with Oracle
My Data1 is in fact the concatenation of two columns
Select Data1_1||Data1_2, avg(Data2) From Table Group By Data1_1||Data1_2
I'm using sorces from CVS, with Oracle
Re: JFreeServlet and SQL
Elder
I am still trying to understand your problem. I would still be very interested in seeing the results as displayed from sql plus.
NB I do not think it will make much difference but can you try (This will just add affect displayed labels)
Select Data1_1||Data1_2 as label,
avg(Data2) as Avg_Data
from Table
Group By label
Bryan
I am still trying to understand your problem. I would still be very interested in seeing the results as displayed from sql plus.
NB I do not think it will make much difference but can you try (This will just add affect displayed labels)
Select Data1_1||Data1_2 as label,
avg(Data2) as Avg_Data
from Table
Group By label
Bryan
Re: JFreeServlet and SQL
Hi,
i try your query, but i had a "ORA-00904: invalid column name" for the "Group By Label"
For the result in SQL-PLUS, i have this
Query:
Select Data1_1||Data1_2 as label,
avg(Data2) as Average
from Table
Group By Data1_1||Data1_2)
Result:
LABEL AVERAGE
----------- ----------
XA46055 13
XA46060 12
XA46070 21
XA46080 13
XA46090 11
XA47010 14
XA47020 12
For the error i get with JFreeServlet:
java.lang.ArrayIndexOutOfBoundsException
at com.jrefinery.data.JdbcXYDataset.executeQuery(JdbcXYDataset.java:188)
at com.jrefinery.data.JdbcXYDataset.(JdbcXYDataset.java:120)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.createXYChart(BaseImageServlet.java:207)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.createChart(BaseImageServlet.java:191)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.doPost(BaseImageServlet.java:597)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
i try your query, but i had a "ORA-00904: invalid column name" for the "Group By Label"
For the result in SQL-PLUS, i have this
Query:
Select Data1_1||Data1_2 as label,
avg(Data2) as Average
from Table
Group By Data1_1||Data1_2)
Result:
LABEL AVERAGE
----------- ----------
XA46055 13
XA46060 12
XA46070 21
XA46080 13
XA46090 11
XA47010 14
XA47020 12
For the error i get with JFreeServlet:
java.lang.ArrayIndexOutOfBoundsException
at com.jrefinery.data.JdbcXYDataset.executeQuery(JdbcXYDataset.java:188)
at com.jrefinery.data.JdbcXYDataset.(JdbcXYDataset.java:120)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.createXYChart(BaseImageServlet.java:207)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.createChart(BaseImageServlet.java:191)
at com.jrefinery.chart.demo.jdbc.servlet.BaseImageServlet.doPost(BaseImageServlet.java:597)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1017)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115)
at java.lang.Thread.run(Thread.java:536)
Re: JFreeServlet and SQL
Eldar
When developing some JdbcXYDataset I did get a lot of java.lang.ArrayIndexOutOfBoundsException errors at varing stages. I had thought I had gotten them all.
I would like to replicate your data and work on a solution. Is it possible to do an oracle export just of the table you are using and email directly to me.
It will be public on coyote as I work on it.
Bryan
When developing some JdbcXYDataset I did get a lot of java.lang.ArrayIndexOutOfBoundsException errors at varing stages. I had thought I had gotten them all.
I would like to replicate your data and work on a solution. Is it possible to do an oracle export just of the table you are using and email directly to me.
It will be public on coyote as I work on it.
Bryan