• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SQL Exception Invalid Descriptor Index

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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";

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");


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
 
reply
    Bookmark Topic Watch Topic
  • New Topic