Board index » jbuilder » ConnectionPool

ConnectionPool


2004-04-17 06:59:49 PM
jbuilder17
I have used ConnectionPooling with JDBC applications, how do we achieve this in JBuilder. I couldn't just use "Connection" because whenever we create a querydataset we need to choose Database.
Righnow, all our classes has
database1.setConnection(new connectiondescriptor("");
We would like to optimize it, say if we change the dbpassword we need to change everywhere.
What I would like to achieve is sth similiar to connection pooling, can I do database pooling :-)
If you have any ideas please let us know,
thanks
 
 

Re:ConnectionPool

In <40810e25$ XXXX@XXXXX.COM >Vani S wrote:
Quote

I have used ConnectionPooling with JDBC applications, how do we
achieve this in JBuilder. I couldn't just use "Connection" because
whenever we create a querydataset we need to choose Database.
Same as you did before...<G>
Seriously, it is hard to advise on this becuase I don't know where
you prevously did your pooling. It was either from a "container" or
from a standalone pooling mechanism (the driver even..). JBuilder can
create all those conitiond for you (assuming you have the right version
of JBuilder for that situation)
So.. if you can provide more details on your situation, maybe we can
provide some ideas..
John..
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/papers.html
====================================================
 

Re:ConnectionPool

Thanks a lot for your reply John.
I had a class which will create maxNum of connections.
This is how I did before in a connection pooling class:
//not a detailed code but I guess it will give an idea.
private Connection makeNewConnection(){
Class.forname(driverName);
Connection con = DriverManager.getConnection(url, user,pass);
return con;}
public Connection getConnection(){
if (connectionCount != maxConnections) makeNewConnection();
}
We are using JBuilder 9, Microsoft SQL server, jtds driver from sourceforge.
Right now, in the designer when we create a querydataset the first thing we do is to select the database. And then check the query.
Database1.setConnection(new Connectiondescriptor(??);
I am new Jbuilder (you might have guessed).
If you can provide me some idea that would be great.
Thanks again,
John B. Moore (TeamB) < XXXX@XXXXX.COM >wrote:
Quote
In <40810e25$ XXXX@XXXXX.COM >Vani S wrote:
>
>I have used ConnectionPooling with JDBC applications, how do we
>achieve this in JBuilder. I couldn't just use "Connection" because
>whenever we create a querydataset we need to choose Database.

Same as you did before...<G>

Seriously, it is hard to advise on this becuase I don't know where
you prevously did your pooling. It was either from a "container" or
from a standalone pooling mechanism (the driver even..). JBuilder can
create all those conitiond for you (assuming you have the right version
of JBuilder for that situation)

So.. if you can provide more details on your situation, maybe we can
provide some ideas..

John..

--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/papers.html
====================================================
 

{smallsort}

Re:ConnectionPool

In <4084ffda$ XXXX@XXXXX.COM >Vani S wrote:
Quote

Thanks a lot for your reply John.

I had a class which will create maxNum of connections.

This is how I did before in a connection pooling class:
Basically you will do the same.. After you have setup the direct
database connection in the designer, they you will "hand adjust" the
connection to your pooler. Realize that the designer will not
understand your pooler so you "design time" functionality will no longer
work. Therefore you may want to hold off on the pooler untill you have
done all the design work..
I usually don't have to deal with designer issues because about 99% of
what I do is server backend stuff.. There it is not an issue.. Maybe
someone will pipe in with a suggestion on how to get the pooler to work
with the designer.
John..
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/papers.html
====================================================