Right. The method is completely inert.This is the query method from the Database class. My issues iare the JTable and JScrollPane are not recognized because they are part of the other class.
They also have nothing to do with a database query, which could be run from anywhere.This is the query method from the Database class. My issues iare the JTable and JScrollPane are not recognized because they are part of the other class.
So, on the subject of using methods that return a value, should my Connect() and Disconnect() Methods return Boolean variables that tell weather the database is connected?
Brennen smith wrote:Ok so I now understand your code and the idea behind it I have used basically the same concept.When I declare this class I am assuming i am returning Object[][] because it is a multidimensional array or an array of an array.
So my problem now is the list declaration that returns the result set.When I insert this line into my program I get the error: java.awt.list Does not take parameters I have never used list before. I tried a few ways to resolve the issue but I am getting no where.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Brennen smith wrote:will java.util.list work with arrays?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
return.data.toArray(); is highlighted with the exception
incompatible types
required java.lang.Object[][]
found: java.lang.Object[]
Winston Gutkowski wrote:PS: That doesn't work either. Will get back as soon as I have a solution.
Brennen smith wrote:This goes back to my particular weakness with passing values. I have been reading up. Does this mean that the values being returned are not valid. or is the issue in this line of code?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
One other thing you could do (and which I probably should have done in the first place) is to validate the parameter, ie, add:(or something like it) as the first lines of all methods that take a ResultSet.Brennen smith wrote:This goes back to my particular weakness with passing values. I have been reading up. Does this mean that the values being returned are not valid. or is the issue in this line of code?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here