View Single Post
  #1 (permalink)  
Old 04-18-2008, 01:10 PM
raj reddy raj reddy is offline
Member
 
Join Date: Apr 2008
Posts: 30
raj reddy can only hope to improve
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)
Reply With Quote
Sponsored Links