NO.
That's the constructor. That one is by definition not supposed to execute code.
public class ItemDetails extends JInternalFrame{
private Connection oConnection = null;
public ItemDetails(){
}
private Connection getDBConnection(){
if(null == oConnection){
Connection oConnection = Connect.ConnectDB();
}
return oConnection;
}
}
you can at any time access that function and try to get the connection.
If it is not valid, the connection is created new. Interesting, because server connection get sometimes "lost" (e.g. due to exceptions).