By memiso
via memiso.com
Published: Nov 24 2009 / 07:24
Before giving structures, we need to notice a little detail about making database connections in Java. All database connections must be stated in try and catch statements, because there is a possibility of getting an exception. That’s way, we try to make our connection in try statement. If our connection attempt fails, that means there is an exception, and the exceptions must be catched.



Comments
vaibhavmishra replied ago:
I don't get it, why is so much down votes, is it the MS factor?
apolci replied ago:
No, it isn't the MS factor.
Simply the code is really bad and shouldn't be taken as reference.
For example look at the myconn static field. Why it is a field instead of a local variable?
Voters For This Link (6)
Voters Against This Link (20)