[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Problem in closing the connection to database?

ritesh163 do-not-reply at jboss.com
Thu Jan 17 00:23:02 EST 2008


Hello jaikiran,
Thank you for the suggestion.
But the main thing is that for the same project, jboss-4.0.4.GA doesn't display any error message while jboss-4.2.2.GA does. I am creating separate function for connection only which will return connection object to main function, the code is given below. And the return connection object is closed at main function. This function is called frequently, which is the main ponit.Will I have to create other function for closing this connection, making Connection as global variable? Please provide me with the suggestion that will solve this problem...

The code for function is :

public java.sql.Connection getConnection() throws java.sql.SQLException { java.sql.Connection connection = null;
    try {
......
      connection = dataSource.getConnection();
      
    }
    catch (Exception ex) {
      ex.printStackTrace();
      }
    return connection;
  }


Thank you.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120710#4120710

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120710



More information about the jboss-user mailing list