This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
String b1="select a.material_no, a.po_unit, a.po_qty, a.recv_qty,a.last_recv_date, a.poclosed_flg, b.material_nm from po_dtl a,material_mst b where a.section_c='"+c+"' and a.po_no='"+e+"' and a.material_no=b.material_no";
rs=stmt.executeQuery(b1); while(rs.next()) { j= rs.getString("material_no"); k= rs.getString("material_nm"); //l= rs.setString("po_unit"); //m= rs.getInt("po_qty"); //n= (int)(rs.getInt("recv_qty")); //o= rs.getDate("last_recv_date").toString(); //p= rs.getString("poclosed_flg"); ABOVE IS MY CODING.IN ALL THE COMMENT STATEMENTS I M GETTING AN SQL ERROR WHILE MY PROGRAM RUNS INVALID DESCRIPTOR INDEX. CAN U HELP ME TO RESOLVE IT.
David Freels
Ranch Hand
Joined: Feb 01, 2001
Posts: 102
posted
0
Originally posted by anurag mittal: String b1="select a.material_no, a.po_unit, a.po_qty, a.recv_qty,a.last_recv_date, a.poclosed_flg, b.material_nm from po_dtl a,material_mst b where a.section_c='"+c+"' and a.po_no='"+e+"' and a.material_no=b.material_no";
Try using this: j= rs.getString(1); k= rs.getString(7); l= rs.setString(2); m= rs.getInt(3); n= (int)(rs.getInt(4)); o= rs.getDate(5).toString(); p= rs.getString(6); -OR- Use the resultset metadata to view the column names that are being returned. Each db handles this diffrently and since you are performing a simple join, the db may be sending the name back with the table alias prefix. Hope this helps. David