hi

i have binding database with combo box and i want to when i will click on any item in the combo box then related records are shown. for this purpose i had use connectivity and use ItemStateChanged() event for combobox event but some errors are occured

please help

This is my code

ResultSet rs;

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:project ","scott","tiger");
String s="select cltid,cltname from cltdetail where cltid=?";
PreparedStatement stmt=con.prepareStatement(s);
int cid1;
cid1=Integer.parseInt(cid.getSelectedItem());
stmt.setInt(1,cid1);
rs=stmt.executeQuery();

if(rs.next())
{

name.setText(rs.getString(2));


}
con.close();
stmt.close();
}
catch(Exception e1)
{
e1.printStackTrace();
}



java.sql.SQLException: [Oracle][ODBC]Invalid column number <2>.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6958)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7115)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(JdbcOdbc. java:3812)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(Jdb cOdbcResultSet.java:5639)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcRes ultSet.java:582)
at GODOWNDETAIL.sidItemStateChanged(GODOWNDETAIL.java :220)
at GODOWNDETAIL.access$400(GODOWNDETAIL.java:6)
at GODOWNDETAIL$5.itemStateChanged(GODOWNDETAIL.java: 107)
at java.awt.Choice.processItemEvent(Choice.java:609)
at java.awt.Choice.processEvent(Choice.java:576)
at java.awt.Component.dispatchEventImpl(Component.jav a:3984)
at java.awt.Component.dispatchEvent(Component.java:38 19)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 463)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:110)
BUILD SUCCESSFUL (total time: 9 seconds)


These errors are occured