File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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 ?