It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

Need help with this

Need help with this

Postby Sillymonkey on Sun Aug 10, 2008 5:03 pm

Hi guys.This is my first post with first problem.
Here is the code
Code: Select all
rs1 = stm.executeQuery("Select * from tblStudent where ClassID='"+ ID +"'");
          ResultSetMetaData rsmd = rs1.getMetaData();
          
          
          int columns = rsmd.getColumnCount();
          ColName = new Vector();
          for(int i=1;i<=columns;i++)
          {
       [b]ColName.addElement(rsmd.getColumnName(i));[/b]          }
          
          while(rs1.next())
          {
             [b]Vector tmp = new Vector();
             tmp.addElement(rs1.getString("RollNo"));
             tmp.addElement(rs1.getString("StudentName"));
             tmp.addElement(rs1.getString("Address"));
             tmp.addElement(rs1.getString("Tel"));
             tmp.addElement(rs1.getDate("BirthDay"));[/b]             
             MainData.addElement(tmp);
          }


The first bold line is the problem.I run my project and i showed "java.lang.ClassCastException"

But in the second bold line,the same trick,same syntax and i had no problem.

Why?plz tell me
Sillymonkey
 
Posts: 0
Joined: Sun Aug 10, 2008 4:56 pm

Who is online

Users browsing this forum: No registered users and 1 guest