• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sql query result into a JTable

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
having problems with inserting a sql query resultset from an oracle table into a JTable
approach adopted:
ResultsModel model=new ResultsModel();
JTable table=new JTable(model);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
resultsPane=new JScrollPane(table);
.
.
try{
model.setResultSet(statement.executeQuery(query));
}
catch(SQLException sds)
{}
tried using both versions jdk 1.2.2 and 1.3
error :- class ResultsModel not found with jdk 1.2.2
and canoot resolve symbol ResultsModel with jdk 1.3
Reference Ivor Horton page no 1047 ...
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would appear that the class ResultsModel is a class that Ivor custom wrote. There is a constructor for JTable that take a TableModel as an argument. TableModel is an interface, so it would be possible to create a custom class that extends ResultSet and implements TableModel. My guess is that this is what Ivor has done with the ResultsModel class. You will need to get this class for the program to work.
 
please buy this thing and then I get a fat cut of the action:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic