Hi, I am using BIRT 2.2.0 . I have created a class that access mysql database and returns some data. This class I am using for a scripted data source. Now the problem that I am facing are :
1. For every creation of report , two database connection are made to the database. I am not able to figure out why ?
2. After the report is rendered , those connection do not terminate and continue indefinitely and are closed only after I close eclipse. Thus connections keep on gathering and after sometime databases server crashes.
I guess their is no error with the class file. Evern so it is as follows
public class Mysqlclass { public List<String[]> data() { Connection con = null; ArrayList <String[]> result = new ArrayList <String[]>();
try { Class.forName("com.mysql.jdbc.Driver"); String url = ""> // Get a connection to the database for a // user named auser with the password
// drowssap, which is password spelled // backwards. con = DriverManager.getConnection(url, "root","password"); Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select UserLogin,StatType from table");