Home arrow static arrow Java Programming [Archive] - ArrayLists
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - ArrayLists
This topic has 2 replies on 1 page.

Posts:65
Registered: 7/13/04
ArrayLists  
Jul 18, 2004 8:01 PM



 
Would the following produce an list of my query or do I need to do something else with it?

if (con != null) {			Statement statement = con.createStatement();			List result = (List) statement.executeQuery(query); 			//set the local datamemeber to the			//query result			this.rs = result;		} else {			this.rs = null;		}


Could I later assign this list to an ArrayList and iterate through it with an iterator? I'm not too clear on what exactly a List is and how it's populated.
 

Posts:24,517
Registered: 98-02-27
Re: ArrayLists  
Jul 18, 2004 8:25 PM (reply 1 of 2)



 
[url http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html]Retrieving Values From Result Sets[/url]
 

Posts:81
Registered: 6/9/04
Re: ArrayLists  
Jul 18, 2004 8:34 PM (reply 2 of 2)



 
The List object itself provides a ListIterator which provides all the functionality of Iterator plus more.
 
This topic has 2 replies on 1 page.