I am writing a simple class to make a connection with the database. I want to reuse the class through out my application. Can anyone tell me, how should i do it? I am using JSP and JavaBeans. I want to reuse the method of the class inside the Bean.
The main method is only required as an access point for the JVM. If you are writing a class as a stand alone app, then you need a main method to run it. If your class is part of an application however, it would be called by another class. And course if you are using JSP there is no main method there either.
This is pretty basic stuff - if you are unsure about how this works I'd spend a little time reading up on the basics before trying any JDBC.