Good Evening All,
I am fairly new with
Java and just playing around creating various little tools and applications while studying for my
SCJA. I have been reading through the Oracle tutorials regarding the use of
JDBC and I am curious about some things.
1) Is it better practice to make a DB Utility class to make a connection to the database each time a query needs to be executed on the dbms or is it better practice to create a db class that allows the connection to stay open and then I can just pull a reference to the connection each time.
2) I have also seen the connection established two ways, the first:
And the Second:
I am curious if the first call to load the driver is a necessary check. I know my error handling needs to be better.
Just curious.
Thanks,
Mike