Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sql query result into a JTable  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!