JDBC and Servlet Sample Code

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Bryan

Re: JDBC and Servlet Sample Code

Post by Bryan » Sat Apr 06, 2002 3:09 am

Jenny

Pleased that you got it working with the new war file.

With reference to the example3. In having a look I found and fixed a small error in the setting the dbSchema option in the init() method of BaseImageServlet. Would I be right that you have set dbSchema to empty in the web.xml file? If so, a quick fix would be to try setting it to your db user name, let me know how you go.

A couple of things.
1. By default the servlets return jpeg types. (I probably should make it selectable on the search page). I have added descriptions of all base options to the web site for the next release.
2. "almost nothing appears on my screen except two axes and a legend icon." This would generally mean that no results where returned from the query.
3. If you are debugging with tomcat you can check the logs directory for info
or try starting tomcat from the command line ./tomcat.sh run.

Here are the options to the sql image servlets. Change the example2.html and 3 <form> types from post to get if you would like to experiement with. (IE to return svg images etc)

* type integer the type of chart to generate. eg moving average, linear fit etc
* under development.
* width integer The width of output in pixels. Clipped into the range 10-2000
* height integer The height of the output in pixels. Clipped into the range 10-1000
* initColor integer Between 0-11, used to indicate the initial shading of the background
* finalColor integer Between 0-11, used to indicate the final shading of the background
* title String The chart title
* xaxistitle String The x axis title
* yaxistitle String The y axis title
* zero String if passed a value of 'true' then the chart will include zero
* showLegend String if passed a value of 'false' then the chart will not include legend
* output String Selection of the type of output requested. jpeg, gif, svg

Bryan

jenny

Re: JDBC and Servlet Sample Code

Post by jenny » Mon Apr 08, 2002 1:52 am

:)
I will try it then.
Jenny

jenny

Re: JDBC and Servlet Sample Code

Post by jenny » Mon Apr 08, 2002 3:00 am

Hi,Bryan
I have set dbSchema to 'system' user in the web.xml file.
Perhaps you have misunderstood my meaning.
I said that "almost nothing appears on my screen except two axes and a legend icon."
----If I simply 'submit' the form and leave the parameters unchanged(as default), I can see a beautiful curve. So I think that the results have returned from the query successfully.
You know, there are some other parameters such as 'Air Temperature (deg C)', 'Barometric Pressure', and 'Fluorometer'. If I checked some of those boxes then submit the form---"almost nothing appears on my screen except two axes and a legend icon".
Because I haven't read your code carefully, I have no idea about setting these parameters .
Anyway, I'm glad to hear your advice.

Regards,
jenny

Bryan

Re: JDBC and Servlet Sample Code

Post by Bryan » Mon Apr 08, 2002 5:09 am

Jenny

I have just sent david another update to the war file. So in the next day or so it should be available. The main change is that the sql generated for each query is outputed / logged, so that you will be able to see what is actually being asked for.

Basically selecting additional parameters changes the sql generated so, the easiest way to see what is going is to have a look at the sql generated.

let use know how hings go.

Bryan

jenny

Re: JDBC and Servlet Sample Code

Post by jenny » Wed Apr 10, 2002 10:04 am

Bryan
I'm going to have a test which is very important for me.
So I haven't had time to download the new package till now.
I feel very sorry...
I think perhaps you are waiting to hear some of my progress...
thank you for your contribution first.
When I'm free, I will test the new program to see if the problem still exists.

^_^ ^_^
jenny

Locked