I am developing a simple JEE web application, using MySQL database and JBoss AS on Eclipse IDE. I did create the connection pool parameter and I connected successfully to the database using connection parameters through ds-mysql.xml file in JBoss AS.
My question is, do I need to create a connection class as a skeleton, and pass this connection to other classes or pages to create sql Statement class? or does the connection pooling mechanism is in charge of manageing all the opended connections through the web application?
Each time you ask for a connection from the connection pool, you are given an available connection. If the same thread (in a single request) asks for connections in multiple places, each will be a different connection. That is a good way to run out of connections very quickly and a good way to really confuse things because each connection handles its own database transaction. It is usually better to get a connection once, per request, and use only that one connection for all database work.
Can you please tell me, where you have done the setting for the connection pooling? Weathor it was done inside the mysql-ds.xml or jboss-service.xml as mbean or separate hibernate-service.xml in .har file?
Let me know what property and attribute was used for setting.