Hello,
I work with JSF and I in one of my Java beans this code:
Code:
Public class MasterBean {
private List <ItemBean> coll, rwlst;
Public MasterBean() throws SQLException {
ResultSet rslt =null;
try{
String u ="jdbc: oracle: thin: @ 192.168.100.35:1521: ORCL";
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Connection conn = DriverManager.getConnection(u,"user","not");
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
rslt = stmt.executeQuery("SELECT FROM sym PVMCA WHERE id_cc = 11042920002");
}
catch (...)}
rwlst = new ArrayList <ItemBean>();
while (rslt.next())
{
coll = new ArrayList <ItemBean>();
String tmpSym = rslt.getString("sym");
coll.add(new ItemBean(tmpSym));
}
}
Public List getList <ItemBean>() {
return coll;
}
Public void setlist(List <ItemBean> coll) {
this.coll = coll;
}
}
When I compile the code I get an error, I think that this is a Arraylist overwriting problem. Please check my code and if I am wrong somewhere then please guide me with the correct.
Bookmarks