query = "Select Id,Name from Master" ;
while(r.next()){
CompId = r.getInt("Id") ;
System.out.println(r.getString("Name")) ;
query = "Select Distinct(TransId) from Transaction where TransId = "+CompId ;
r1 = s.executeQuery(query) ;
while(r1.next()){
System.out.println(r1.getInt("TransId")) ;
}
}
The first thing I would do is try a simple join as in:
query = "Select Id, Name, Distinct(TransId) from Master, Transaction where (TransId = Id)"
The reason the resultSet might be getting closed out is because it reaches the end of the rows selected for. Make sure you are getting the data you expect. Another reason might be that your
JDBC driver is buggy.
Julio Lopez
M-Group Systems
[This message has been edited by Julio Lopez (edited June 07, 2001).]