Results 1 to 2 of 2
- 10-09-2012, 12:14 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
Trying to show a query from my DB in a jtable
hello
i have a query and i try to show it as a table in my gui
i did :
and debugged it the sql part is right and doesn't jump to exceptionJava Code:jTable1.setVisible(true); try{ Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","",""); Statement stmt= con.createStatement(); ResultSet rs=stmt.executeQuery("SELECT * FROM lib.books_out"); JTable jTable1 =new JTable (DBUtils.resultSetToTableModel(rs)); } catch(Exception e){System.out.println("Bad Connection"+e.getStackTrace());}
however the jtable is printed empty
any ideas ?
thanks to all the helpers
- 10-09-2012, 12:49 AM #2
Member
- Join Date
- Jan 2011
- Posts
- 39
- Rep Power
- 0
Similar Threads
-
From query to JTable
By drimades in forum JDBCReplies: 2Last Post: 03-07-2012, 04:43 PM -
Using jTable to display query result
By zenith666 in forum New To JavaReplies: 2Last Post: 01-13-2012, 02:29 AM -
JTable Query
By Siddharth Singh in forum AWT / SwingReplies: 1Last Post: 01-11-2012, 03:36 PM -
JTable doesnt show columun names!
By phil128 in forum AWT / SwingReplies: 3Last Post: 03-08-2009, 10:39 PM -
netbeans 6.0 not show commpunent or show blank page
By fahimaamir in forum NetBeansReplies: 1Last Post: 01-26-2008, 06:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks