> I have a peice of code which i am getting loads of
> problems with the only thing i can think of is that i
> am using generics, can somebody tell me another way
> to write this without using generics?
>
> List<VidBean> videos = new ArrayList<VidBean>();
What is the problem exactly? Does it complain about VidBean not being found?
it says:
List<VidBean> videos = new ArrayList<VidBean>(); /// can i put this as a array whats <> for?
^
1 error
Errors compiling finderBean.
but i would rather chnage it so it doe not use generics, can anybody tell me what the alternative is?
yeah i tried that but now instead of the error from above i get 6 errors:
myBean.java [38:1] cannot resolve symbol
symbol : method forName (java.lang.String)
location: class Class
Class.forName("com.mysql.jdbc.Driver").newInstance();
^
myBean.java [71:1] incompatible types
found: java.util.ArrayList
required: List
List videos = new ArrayList();
^
myBean.java [73:1] cannot resolve symbol
symbol : class VidBean
location: class finderBean
VidBean video = new VidBean();
^
myBean.java [73:1] cannot resolve symbol
symbol : class VidBean
location: class finderBean
VidBean video = new VidBean();
^
myBean.java [74:1] cannot resolve symbol
symbol : method getInd (java.lang.String)
location: interface java.sql.ResultSet
video.setRecId(rs0.getInd("recording_id"));
^
myBean.java [86:1] cannot resolve symbol
symbol : variable stmt
location: class finderBean
stmt.close();
^
6 errors
Errors compiling myBean.
I have managed to get rid of some of those errors but am left with these ones. Ifi i change listvids = new arraylist() to just a list that error goes away but having not used lists before i do not know if that is correct or not.
myBean.java [38:1] cannot resolve symbol
symbol : method forName (java.lang.String)
location: class Class
Class.forName("com.mysql.jdbc.Driver").newInstance();
^
myBean.java [76:1] incompatible types
found: java.util.ArrayList
required: List
List vids = new ArrayList(); // use this instead i think // works if i put it as list not array list
^
myBean.java [96:1] cannot resolve symbol
symbol : variable stmt0
location: class myBean
stmt0.close();
^
3 errors
Errors compiling myBean.
I have now got rid of two of those errors and i am just left with :
mysite/myBean.java:96: cannot resolve symbol
symbol : variable stmt
location: class mysite.myBean
stmt.close();
^
1 error
can anybody see whats up with it?
Message was edited by:
eastenders
sorry i don't quite understand that i dont have a class file called calss or list if thats what you mean, the only error i get now is:
mysite/myBean.java:96: cannot resolve symbol
symbol : variable stmt
location: class mysite.myBean
stmt.close();
^
1 error
Problem solved, i put the stmt.close() in the wrong place i put it after the catch!
Message was edited by:
eastenders