So I have this interface QueryAndRetrieval and I would like to force each of the classes that implements it to have a few variables as well as a few very simple methods, however if I try to define a vaiable as the one on line 5
public interface QueryAndRetrieval {
public String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
public String JDBC_URL = "jdbc:derby:CompanyDB;create=true";
public static Connection conn;
public boolean containsEntry(String TableName, Object key);
public static Connection connect() throws SQLException {
return DriverManager.getConnection(JDBC_URL);
}
}
Eclipse informs me that
The blank final field conn may not have been initialized
but there is no final field within the interface whatsoever. Could anyone tell me why this is happening and how to resolve it? Please assume that all the necessary and correct imports are present within the interface.