I am getting this error when i use a string array java.lang.NullPointerException
The code i used is as follows..
String[] list = null;
String sql = "SELECT * FROM pos_products";
ResultSet rs = mysql_query.execute_mysql(variables.con.conn, sql);
while (rs.next()) {
System.out.println(rs.getString("product_name"));
list[i] = rs.getString("product_name");
i++;
}
I have to add one more thing after seeign this replies.. First thank you guys for your response.. Now the problem is i am using JList and i have to add content to it.. If i use list i cant add directly. i can user either vector or a string array. what is your thoughts on that ??