Discussions

General J2EE: Creating JDBC Connection Pool programmaticalli for glassfish.

  1. Hi I want to create JDBC connection pool in the server programmatically. that is an application admin can define a datasource for the application. (Oracle , Ms SQL, MySql, or DB2) this will be the datasource used by the EJB part of my application. Can anyone explain me how to do this programmatically... either by creating an XML file and copying it to a directory i nthe server or using JMX. I cannot use asadmin utility since it is sifficult to make a native call since the app is definitely gonna run in all platforms. thanks
  2. I am surprise you have to do this programmatically when containers provide out-of-the-box support for what you are trying to do.... .....pl. don't even plan to go this route... it will be a fiasco if you decided to do so..... Especially from performance tuning perspective it will be a nightmare to deal with if you do this programmatically... Sorry for discouraging but that’s the reality…. Still if you wanted to write your own connection manager then check up on any open source connection manager stuff which will give you some headway. Good luck, Cheers H. Kanthi
  3. Hi I think you have got my point wrong. I want to define a new datasource in the server when the user wants to change the database he's using. for example lets say the DB server is MSSQL and resides in server name "ARC". And there is a Connection Pool defined in the App Server for the SQL server in ARC. But user decides to move the DB to a server called "NOAH" then I cannot ask the user to go to the admin console and change the datasource. I need to provide a GUI tool for the user to do it. Its a somethin like what u have in netbeans "server resources" . netbeans will allow you to configure a datasource from the IDe and deploy it. This is the same thing i want to do.
  4. why would you want to do this?????????? use an open-source connection pool and call it a night,and get a drink. if you really want to do this, just download the source code for c3PO and see how it's done..they use a .properties file..
  5. Please refer the following sections http://blogs.sun.com/JagadishPrasath/entry/creating_jdbc_connection_pool_resource#3_Using_sun-resources.xml_templates http://blogs.sun.com/JagadishPrasath/entry/creating_jdbc_connection_pool_resource#4_Creating_Connection_Pool__Resource to create a connection pool by copying templates and programatically. Thanks, -Jagadish