Jump to content

Close connection in ireports


javi_123

Recommended Posts

Hi all,

 

we have designed a dashboard in ireports  and have declared "MetaDataConnection" as a parameter which establishes a connection with the database.

The class Type of the parameter is "java.sql.Connection" and default value expression is "java.sql.DriverManager.getConnection("jdbc:mysql://localhost/jasperserver", "username", "password")".

 

The above connection works fine but when it crosses more than 200 connections which is the limit, the dashboard crashes. After every click a connection is established.

I then tried to use another parameter called "CloseDataConnection" in which i used the class type as "java.sql.Connection" and the Default value expression as "$P{MetaDataConnection}.close()"

but unfortunately this dosent work and i dnt knw how to close the connection in ireports.

 

I am not getting anywhere with this problm. Have tried searching on google and ireports forums but no result.

 

If anyone knows the solution to this problem please reply back as soon as possible.

I just need to close the connection evrytime when it executes the query.

 

Please if u knw the solution, then reply back asap.

 

Cheers
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...