bfollek Posted January 21, 2008 Report Share Posted January 21, 2008 I'm using JDBCDataProvider and setDataSource() to create a chart in a servlet. I write the chart to the browser using getHtmlData(). In my testing, it seems that I have to keep the resultset open till after my getHtmlData() call or I get a 500 error. But some of the examples seem to close the connection right after setDataSource(). What am I missing? TIA Quote Link to comment Share on other sites More sharing options...
GabrielA Posted January 21, 2008 Report Share Posted January 21, 2008 Chart FX doesn't need the conection to be opened, it just need access to the sql Resulset. Try to go through the data in the resulset after the conection is closed to be sure you are not passing an empty rs to the chart. Quote Link to comment Share on other sites More sharing options...
bfollek Posted January 21, 2008 Author Report Share Posted January 21, 2008 Thanks. I'm trying to pinpoint when the ChartServer object actually reads the ResultSet. This seems to be at getHtmlData() time. This matters for jdbc cleanup. Closing the connection, but hoping the resultset will still be there...I wouldn't want to depend on that behavior. At any rate, I like to explicitly close the resultset, then the stmt, then the connection. Quote Link to comment Share on other sites More sharing options...
GabrielA Posted January 22, 2008 Report Share Posted January 22, 2008 Yes, the resulset is read when you call either getHtmlData or getHtmlTag. The problem you will find is that there is no way to close them after you call getHtmlData. Bu you can use getHtmlDataEx, which will give you the chart stream, then you can close all object and send the chart to the browser when you are finished. There are some getHtmlDataEx samples in the sample\misc folder of the installation. Quote Link to comment Share on other sites More sharing options...
bfollek Posted January 24, 2008 Author Report Share Posted January 24, 2008 >... there is no way to close them after you call getHtmlData. I'm calling getHtmlData() in a try block, and closing the jdbc objects in the finally block. Seems to be working - print statements in the finally block go to the console, so I know it's running. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.