This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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 ?