We have set up JDBC connection using JNDI as follows.
InitialContext context = new InitialContext();
//Look up our data source
DataSource ds = (DataSource) context.lookup("Oracle");
//Allocate and use a connection from the pool
con = ds.getConnection();
We are able to get the connection and all but we encounter maximum connection reached after executing several queries. It seemed that we didnt release the connection.
How can we release the connection?
Thanks for the help.