This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes can we use an static method to return connections when we need them ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "can we use an static method to return connections when we need them ?" Watch "can we use an static method to return connections when we need them ?" New topic
Author

can we use an static method to return connections when we need them ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
thank you for reading my post
I have an static method that i create some JDBC connection inside it.
when ever i need a connection i call that method and the method will go tru connection creation scenario ( class.forname.....)
I have doubt that it does not create new connections and always return the same connection because the connection returns some unknown errors like : table aa does not exists..

What is task of an static method , we can call it from the class instead of creating an object of that class , does it have some other features that affect my job ?

thanks
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Yes, you can create connections from static methods, although it looks like your error table aa does not exist is referring to some other problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can we use an static method to return connections when we need them ?