How does a class manage the numbers of connections created to a database?
Printable View
How does a class manage the numbers of connections created to a database?
How does a Class manage anything?
Why don't you describe what it is that you are actually having a problem with?
I was asked to do the following question and im finding it difficult to answer:
Illustrate with java code how a class can manage the numbers of connections created to a database.
An int variable that you increase and decrease with every opened/closed connection?
What you asked and what the assigment asks for are two differents things...
I can think of a connection class, that uses an array(s) and threads to manage it. (I'm not an expert ... I know zip about DB connections). This was just the first thing I thought of.
masijade: what you suggest would just keep track of the currently open connections... it not really would manage anything... probably would part of the conection manager.
Luck,
CJSL
Of course, but then again, he simply said "manage the number of connections", and I never said it was a complete answer.
It was a back-handed sort of way of saying "I am not going to do this for you."
Obviously if it is to truely manage connections then it is going to need to create connections, check that the "max" number has not already been opened, and close connections, and be synchronised, etc, etc, etc. But this is his assignment, and until he shows some effort he's not going to get much from me.
true... it does say manage the "number" of DB connections. therefore I withdraw me comment, but your answer certainly doesn't help the OP.
And yes, the OP most certainly has to do his own work.
yeah... I noticed.Quote:
It was a back-handed sort of way of saying "I am not going to do this for you."
OK and I can respect that. Maybe the next you can say that to the OP, in a nice manner.... maybe like "SHow us where your stuck with the code so we can help you"... Just a suggestion...Quote:
..and until he shows some effort he's not going to get much from me.
So.. back to javahelp00... what have you done? Where are you stuck?
CJSL