|
How to fetch an arralist element (i need the code)
WE HAVE TO CALL THE "SEL1" element IN THE PUBLI STATIC VOID MAIN METHOD.
[ "SEL1" element is located in an array in the public List fetchTicketkey1() method ie
al.add(rs.getInt("sel1")]
public class Keno {
public List fetchTicketkey1() {
List al = new ArrayList();
try {
pstmt=con.prepareStatement("select * from draw );
rs=pstmt.executeQuery();
while(rs.next()) {
al.add(rs.getInt("sel1"));
al.add(rs.getInt("sel2"));
}
} catch(Exception e) {
} return al;
}
public static void main(String[] args) {
Keno ken = new Keno();
List al = (List) ken.fetchTicketkey1();
}}(i need the code)
|