Skip navigation.
Home

DataBase Strinage Behaviour

Dear ALL,

 i'm trying to access some data from
my database but i have A strange behavior and hope to help me to understand
what is happening

when i try to retrieve column data form DB and print it

it will be printed

but when i try to assign it to a String

i get this exception   "NO Data Found" 

Query=" select * from CPM_DEST";

st = conn.createStatement();

rs=st.executeQuery(Query);


while(rs.next())


System.out.println(rs.getString("DESTNAME"));  //printwith no problem


String x=(String)rs2.getString("DESTNAME");//here i get the exception

}

 

Whta's happining..?

Thanks&regards

essam

Essam what is "rs2" I

  Essam what is "rs2" I think that your dataset name is "rs".


Michael's eHome :: Free Coder ...

michael , thank you for

michael , thank you for your writing back...
sorry it was just a writing mistake ,rs2 it supposed to be rs.
 but i'm still stuck
the reply  I got regarding  this issue
 that i can't read the same column  in the same  row twice 
but in my case It’s not  the fault
Thanks &Regrads
Essam