List:MySQL and Java« Previous MessageNext Message »
From:Kevin Athey Date:May 21 2003 1:10am
Subject:Re: ResultSet not having all records
View as plain text  
Here is the code that isn't working:
The sections colored blue work return multiple rows and that in red 
return only 1


users = new Vector();
totalItems = 0;
Connection conn = null;
try {
conn = PoolManager.singleton().getDataSourceConnection("jdbc/wlrepo");
Statement stmt = conn.createStatement();
ResultSet re =
stmt.executeQuery("select * from domain where cd = 'TYPE' order by 
sort_seq;");
types = new Vector();
while (re.next()) {
RepoDomainItem rdi = new RepoDomainItem(re);
types.addElement(rdi);
}
re = stmt.executeQuery("select * from users;");
while (re.next()) {
RepoUser ru = new RepoUser(re);
ru.setItems(getItems(conn, ru.getId()));
users.addElement(ru);
if (ru.getId() == Integer.parseInt(getId()))
user = ru;

Kevin


On Tuesday, May 20, 2003, at 03:55 PM, Jeff Mathis wrote:

> you are executing this via jdbc, or are you within a mysql prompt?
>
> my guess is if you are in jdbc, and there really are that number of 
> rows
> in the table, somewhere a ResultSet.next() is not getting called ....
>
> jeff
>
> Kevin Athey wrote:
>>
>> I have couple of tables with a few rows, 10-15, with one of the tables
>> a 'select * from table' only returns one row, yet on all other tables
>> it returns everything.
>>
>> Any ideas?
>>
>> Kevin
>>
>> --
>> MySQL Java Mailing List
>> For list archives: http://lists.mysql.com/java
>> To unsubscribe:    
>> http://lists.mysql.com/java?unsub=1
>
> -- 
> Jeff Mathis, Ph.D.			505-955-1434
> The Prediction Company			jmathis@stripped
> 525 Camino de los Marquez, Ste 6	http://www.predict.com
> Santa Fe, NM 87505
>
> -- 
> MySQL Java Mailing List
> For list archives: http://lists.mysql.com/java
> To unsubscribe:    http://lists.mysql.com/java?unsub=1
>

Thread
ResultSet not having all recordsKevin Athey21 May
  • Re: ResultSet not having all recordsJeff Mathis21 May
    • Re: ResultSet not having all recordsKevin Athey21 May