Results 1 to 7 of 7
Thread: Java Database Connections
- 02-28-2009, 04:59 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 4
- Rep Power
- 0
- 02-28-2009, 05:03 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
How does a Class manage anything?
Why don't you describe what it is that you are actually having a problem with?
- 02-28-2009, 05:05 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 4
- Rep Power
- 0
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.
- 02-28-2009, 05:09 PM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
An int variable that you increase and decrease with every opened/closed connection?
- 02-28-2009, 05:19 PM #5
to connect or not to connect... that is the question
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,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 02-28-2009, 05:23 PM #6
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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.
- 02-28-2009, 07:41 PM #7
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.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.....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?
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
Similar Threads
-
how to connect a driver in java for jdbc connections to oracle10g
By swathi palla in forum New To JavaReplies: 4Last Post: 02-04-2009, 03:19 PM -
How to control DataBase connections using Spring framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:44 AM -
Rejecting connections from a specific IP
By javaplus in forum NetworkingReplies: 2Last Post: 12-21-2007, 02:28 PM -
How to control DataBase connections using Spring framework
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:15 PM -
Connections to data bases
By Albert in forum JDBCReplies: 1Last Post: 06-09-2007, 03:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks