Ok, I've decided to switch how I store the data for the jTable, but no im running into a shit ton of issues. When I call my getData() it says "Overridable method call in constructor" then when I try to run the program, it says an error with "init" which i see is from the initComponents()... here is the code im messing with, please i need help before I die from overworking on this lol:
public class DeedsTechView extends FrameView{
int R = 0;
String header[] = new String[]{
"First Name", "Last Name","Address", "City","State","Zip","Phone", "Email"
};
private Vector<Vector<String>> data; //used for data from database
public DeedsTechView(SingleFrameApplication app) {
super(app);
initComponents();
try{
String url = "jdbc:odbc:dts";
String user = "";
String password = "";
Connection con = DriverManager.getConnection(url, user, password);
String getCust = "SELECT * FROM Customer";
PreparedStatement ps = con.prepareStatement(getCust);
ResultSet rs = ps.executeQuery();
data = getData(con, rs);
}
catch(Exception e){
System.out.println("Still crasssshinnngg!");
}
}
@Action
public Vector getData(Connection con, ResultSet rs){
Vector<Vector<String>> customerData = new Vector<Vector<String>>();
try{
while (rs.next()){
Vector<String> customer = new Vector<String>();
customer.add(rs.getString(1));
customer.add(rs.getString(2));
customer.add(rs.getString(3));
customer.add(rs.getString(4));
customer.add(rs.getString(5));
customer.add(rs.getString(6));
customer.add(rs.getString(7));
customer.add(rs.getString(8));
customerData.add(customer);
}
return customerData;
}
catch (Exception e){
System.out.print("ERROR IN getData()");
return null;
}
}