hey guys,
I am trying to store into my arraylist a couple of objects that is being referenced from sybase (i do not have the connections in yet so dont worry about that part). But when i run a dummy example of this it is not working correctly. Should i create a project class and create an object with those values then store them into the project_table arraylist class? here is my code
public class Project_Table
{
Private int table_size;
ArrayList Project_Table_List;
Project_Table()
{
table_size = 0;
Private int xproject_ID = 0;
Private String xproject_Name = null;
Project_Table_List = new ArrayList();
}
add(int ID, String Name)
{
xproject_ID = ID;
xproject_Name = Name;
table_size++;
Project_Table_List.add(xproject_ID, xproject_Name)
}
}
import Project_Table
public class Query_Class()
{
Project_Name_Query(int xtype_ID)
{
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select Project_ID, Project_Name FROM Project_Table WHERE Type_ID = " + Integer.toString(xtype_ID));
if(rs != null)
{
while(rs.next())
{
Project_Table.add(rs.getInt(Project_ID), rs.getString(Project_Name));
}
}
}
}
thanks
Randy


Reply With Quote


Bookmarks