you forgot to added and another ...
1) client=new Vector<String>();
to the DefaultTableModel
inside loop while(dane.next()) {...}
2) public Vector getClient()
must be initialized return null
3) change public Vector getClient()
to public void getClient()
, remove return statement
4) PreparedStatement zadanie
must be closed in finally
block try- catch - finally
5) dane = zadanie.executeQuery();
looks like as Resultset, and same as PreparedStatement zadanie
must be closed in finally
block
6) JTable
and Vector
can hold null value
7) if you are only to want to display data from DbTable
to the JTable
then look for ResultsetTableModel
, TableFromDatabase
, you can search for that on this forum too
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…