Unchecked Call to addElement(E)(resultset with vector)
Please i am trying to retreive a number of rows with two columns and am trying to add it into a vector object and ots been giving me this error message.
Unchecked call to addElement(E)
my code will appear below
- --
import java.io.*;
import java.sql.*;
import com.ecom.util.*;
import java.util.Vector;
public class ProdCategory implements Serializable
{
Vector catid=new Vector();
Vector catname=new Vector();
EcomConnection econ;
Connection con=null;
ResultSet rs=null;
Statement stat = null;
/*The following method is used to retrieve the values of category Id and category name from CategoryDet table */
public String getselect()
{
try
{
System.out.println("Getting IN");
econ = new EcomConnection();
con=econ.getConnection();
stat=con.createStatement();
System.out.println("Connected...");
String query="select Ctgry_Id,Ctgry_Name from CategoryDet";
System.out.println("Executing Query");
rs=stat.executeQuery(query);
System.out.println("Executing result set");
while(rs.next())
{
catid.addElement(rs.getString(1));
catname.addElement(rs.getString(2));
}
System.out.println(" ");
rs.close();
stat.close();
econ.releaseConnection();
System.out.println("Connection Closed");
return " ";
}
catch(SQLException sqlex)
{
System.out.println("There is some problem in SQL Execution..." + sqlex);
return "There is some problem in SQL Execution..." + sqlex;
}
catch(Exception ex)
{
System.out.println("There is some other problem " + ex);
return "There is some other problem ..." + ex;
}
}
/*The following method is used to get the value of catid variable*/
public Vector getcatid()
{
return catid;

