Results 1 to 1 of 1
- 12-13-2008, 01:52 PM #1
Member
- Join Date
- Aug 2008
- Posts
- 7
- Rep Power
- 0
problem in get result than SQL to jtable
hi all.
i have a program , now i add Operator manager to add new operator and get list of operator or delete
now Add and Delete is work fine but my ResultSet dont work and give me Null pointer Exeption
ths code in Operatormanager Class
Java Code:public ArrayList<Operator> getlist() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException{ operators = null; operator= null; Command_msg = "SELECT * FROM operator"; dbmanager.getConn(); Statement st = dbmanager.conn.createStatement(); ResultSet res = st.executeQuery(Command_msg); while(res.next()){ operator.setName(res.getString("Name")); [COLOR=Red]// here is exeption[/COLOR] operator.setUsername(res.getString("Username")); operator.setPassword(res.getString("Password")); operators.add(operator); } return operators; }
Java Code:OPManager.getlist(); int i = 0; for (Core.Operator emp : operators) { Table.setValueAt(emp.getName(), i, 0); Table.setValueAt(emp.getUsername(), i, 1); Table.setValueAt(emp.getPassword(), i, 2); i++;
Similar Threads
-
result select sql in jtable
By herfnai in forum JDBCReplies: 0Last Post: 08-17-2008, 01:20 PM -
result select sql in jtable
By herfnai in forum JDBCReplies: 0Last Post: 08-17-2008, 01:20 PM -
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help
By salmanpirzada1 in forum Advanced JavaReplies: 2Last Post: 05-15-2008, 11:15 AM -
problem with displaying result..
By SCS17 in forum New To JavaReplies: 4Last Post: 04-23-2008, 12:19 PM -
Problem with JTable
By Felissa in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 10:25 AM
Bookmarks