This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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.
 
jQuery in Action, 3rd edition
 
subject: can we use an static method to return connections when we need them ?
 
It's not a secret anymore!