I have a JSP application with a plain java class of Login.java and a servlet with a call to a procedure named loginList in the doGet method. The loginList procedure needs to create a list of logins using a java class named OAVDbUtil with a method "getLoginsList". But Eclipse does not seem to recognise the "getLoginsList" procedure and when I enter it the massage of "eclipse cannot make a static reference to the non-static method" is given. But everything looks okay as I have not stated the getLoginsList as static. I think there is a way to create an instance of the OAVDbUtil to avoid having to create multiple instances of New OAVdbUtil objects but can someone tell me how to do this please and NOT get the message of "eclipse cannot make a static reference to the non-static method"?
Here is some code and a screen dump
Screen dump of servlet
Here is the code for the OAVDbUtil
public OAVDbUtil(DataSource theDataSource) {
dataSource = theDataSource;
}
public List<Login> getLoginsList() throws Exception {
List<Login> loginList = new ArrayList<Login>();