Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

null pointer exception in resultset.next()

843854Jul 22 2003 — edited Jul 25 2003
hi ,

i am using multiple resultsets in an array . When i try to use the resultset[index].next() i get an nullpointer exception at while(esub[m].next()). Can any body figure out whats wrong .Here is the code :

ResultSet [] esub = new ResultSet[subnum];
int i=0;
while(subid.next()){

esub[i++] = explevel.executeQuery("select spot_id,expression_level from spotmeasurement where expression_level between "+ low + "and "+ upper + " and subexperiment_id = '" + subid.getString(1) + "'");

}
ResultSet rm,rn,rmg,rng;

for(int m=0;m<subnum;m++){
for(int n=0;n<subnum;n++){

if(m!=n){

while(esub[m].next()){
rm = stmt.executeQuery("select probe_id from spot where id ='"+esub[m].getString(1)+"'");
rm.next();
rmg = stmt.executeQuery("select gene_id from geneasprobe where probe_id='"+rm.getString(1)+"'");
rmg.next();

while(esub[n].next()){
rn = stmt.executeQuery("select probe_id from spot where id ='"+esub[n].getString(1)+"'");
rn.next();
rng = stmt.executeQuery("select gene_id from geneasprobe where probe_id='"+rn.getString(1)+"'");
rng.next();
if(rmg.getString(1).equals(rng.getString(1))){
mat[m][n]=mat[m][n]+1;
} //end of if
} //end of inner while
} //end of while
esub[m].first();
esub[n].first();

} //end of if


} //end of for
} //end of for

bye
chan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2003
Added on Jul 22 2003
12 comments
1,465 views