| Author |
Unable to populate Data in Jtable from Sparql result
|
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
here ,is the code that creates a object of RdfHello and passes it to Result
The Result Gui gives an Empty Table while the textarea gives the required output
In ResultTableModel ,i have tried to populate data from resultset but it gives size=0
please help
|
OCPJP 6.0 93%
OCPJWCD 5.0 98%
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
You never call method rdf() which actually fills the ResultSet.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
You never call method rdf() which actually fills the ResultSet.
i didn't understand .
please be more descriptive.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
You defined method rdf(). This is the only method that reads any data. You do not call this method. Ergo, no data is ever read.
|
 |
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
sorry,i missed that line in the code,
rdf method is bring called.
i think there is some problem in the ResultTableModel or Result class
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Then perhaps the problem is you closing the QueryExecution before reading the data from the ResultSet. I don't know how this works in the library you're using, but with JDBC you cannot read anything from a ResultSet after the (Prepared)Statement that created it has been closed. So you may want to check if the ResultSet has any data before you call qe.close(). If this is the case you need to extract the data from the ResultSet before calling this method.
|
 |
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
|
|
thanks Rob
i commented
and then ran the code again .still,got the size 0
so,i put the entire code of querying in ResultTableModel ,
then,i got the desired results.
can you tell why it isn't working even after commenting
|
 |
 |
|
|
subject: Unable to populate Data in Jtable from Sparql result
|
|
|