667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

General J2EE General J2EE General J2EE Messages: 4 Messages: 4 Messages: 4 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Creating JDBC Connection Pool programmaticalli for glassfish.

Posted by: Lahiru Abeydeera on February 14, 2007 DIGG
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
  Message #227518 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Creating JDBC Connection Pool programmaticalli for glassfish.

Posted by: Hanumanth Kanthi on February 14, 2007 in response to Message #227464
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

  Message #227550 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Creating JDBC Connection Pool programmaticalli for glassfish

Posted by: Lahiru Abeydeera on February 15, 2007 in response to Message #227518
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.

  Message #227687 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Creating JDBC Connection Pool programmaticalli for glassfish

Posted by: Jeryl Cook on February 17, 2007 in response to Message #227464
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..

  Message #230859 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Creating JDBC Connection Pool programmaticalli for glassfish

Posted by: Jagadish Prasath on April 10, 2007 in response to Message #227464
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

Recent active threads Recent active threads Recent active threads More More More
IPhone App Development with JSF
Web as the Platform: Day 1 at the Ajax Experience
Need help for login page using java servlet
Stateful Webservice in java
SAP Asks Sun/Oracle to Let Java Be Free
Registration for TheServerSide Java Symposium Las Vegas now open
Use Sun SPOTs as your build canary
AspectJ In Action Published; Sample Chapters Posted on TSS
WSO2 goes all RESTy
Return to previous view after user action
More active threads »
Top posters of the weekTop posters of the weekTop posters of the week
This list contains the members who have made the most posts in all forums over the last 7 days:
  1. Dan Evans
  2. James Watson
  3. William Louth
  4. sara foster
  5. Chief Thrall
Hot threads Hot threads Hot threads More hot threads More hot threads More hot threads

Object pooling is now a serious performance loss

Brian Goetz continues to lift the lid and peak into the inner workings of Java in Java Urban Performance Legends. In this article he exposes the fallacy behind some of the more common performance myths found in the annals of the JVM.
(93 comments, last posted February 06, 2009)

Beyond Java

Bruce Tate, author of Better, Faster Lighter Java and Bitter EJB has come out with a new book called Beyond Java. Bruce has an epiphany about the future of software development. Does it include Java?
(770 comments, last posted September 23, 2009)

Three forms of AJAX: solid, liquid and gas.

Looks like today AJAX concept have several interpretations. We can distinguish different approaches of AJAX integration. Can they co-exist within the same application? Can we talk about layered AJAX integration?
(68 comments, last posted May 08, 2008)

Design-Time API Promises to make Java more like VB

Artima has published a short article describing the Design-Time API for JavaBeans, which was recently approved as JSR 273. This API promises to bring VB-like ease to Java development, but may face a cultural bias among Java developers who tend to think more in terms of class libraries than components.
(225 comments, last posted November 19, 2009)

Will Sun be that target of a management buyout?

There is plenty of speculation today regarding a potential buyout of Sun Microsystems by Scott McNealy and Silver Lake Partners. How would privatization of Sun affect Java?
(16 comments, last posted May 15, 2009)
More hot threads »

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy      Powered by JIVE
Site Map