java - display sqlite datatable in a jtable -


I'm trying to display a sqlite data table in a Jebet but I got an error "sqlite type only forward "

How can I display it in a jibbles

  try {long start = System.currentTimeMillis (); Statement State = ConnectionBD.Justinstein (). Bnaaastatment (Rijltset. Tiipeedisiaroelaansansitiaiiv, Rijltset. ResultSet res = state.executeQuery ( "SELECT * FROM data"), resulting metadata meta = ReskgetMetaData (); Object [] columns = new Object [MetakgetColumnCount ()] for; (Int i = 1; i & lt; = Metakget Colmkount (); i ++) {column [i-1] = Metakget Colmnam (i);} Res.last (); Int rowCount = res. GetRow (); object [] [] data = new object [res.getRow ()] [meta.getColumnCount ()]; res.beforeFirst (); int j = 1; while (res.next ()) {for ( int i = 1; i & lt; = meta.getColumnCount (); i ++) data [j-1] [i-1] = res.getObject (i); J ++; } Res.close (); state.close (); long time = system. The current time () - start; result.removeAll (); Result.add (new JScrollPane (new JTable (data column)), BorderLayout .CENTER); Result.add (new Jeelab ( "" + total time + perform MS "and" + line count + "Ligne (s)"), border layout. SOTH); result.revalidate ();} catch (SQLException e) {result.removeAll (); Result.add (new JScrollPane (new JTable ()), BorderLayout.CENTER; Result.revalidate (); Employmentpan Show Messegidoug (Vacant, E. Gate Message (), "ERRURR!", Joppenpain.ARROR_MSES); }  

thanks

call To do res.last () which is causing the problem. If you want to know how many rows are, then you can either simplify a SELECT count (*) FROM (<-your-query & gt;) base or an object Instead of using an ArrayList array to keep the rows (you can still use the object for each line, since the number of columns is known before time.)


Comments