Re: Pool error connecting to database
Posted by: Tetsuro Ikeda
Date: June 03, 2005 04:16AM

> public GestorBD(String sNombreBase) {
> try {
> String login = "MLERTXUNDI";
> String password = "894022";
> String bd = sNombreBase;
> String url =
> "jdbc:mysql://" + bd;
> Class.forName("com.mysql.jdbc.Driver").newInstance
> ();
> conexionBD =
> DriverManager.getConnection(url, login,
> password);
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }

Hi Mikel,

Thanks for posting the code above.
I think this code is perfect and _never_ has problem ;)

Regarding to this code, the case StandardSocketFactory#connect method called is
_only_ when Connection's constructor is invoked.

And only 1 time invocation of StandardSocketFactory#connect by each Connection's
Constructor, while I'm reading Connector/J ver3.1.8's source code.

Ok, could you add some System.out.println to the code above and run the application?
This is for checking how often this code calls Connection's Constructor.

-- Tetsuro

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.