i only get one entry
Norm Radder wrote:
i only get one entry
The setText() method replaces what is shown with the new String.
Use the append() method if you want to keep what was being shown and append the new String following the old.
Note: Please edit your post and fold the long lines to keep them in a smaller horizontal area.
All things are lawful, but not all things are profitable.
Knute Snortum wrote: It looks like the return is inside the while loop. This would give you only one row.
Dave Tolls wrote:
The above is not how you use a PreparedStatement, by the way.
The code ought to be something like:
And then you bind (set) the values to use for the '?' placeholders:
Domenik Steckling wrote:
i did kinda the same just with variables and not manually entering everything
Dave Tolls wrote:
Domenik Steckling wrote:
i did kinda the same just with variables and not manually entering everything
Except that's just a normal Statement, the way you wrote it.
To have a PreparedStatement (and take advantage of the databases ability to pre-plan statements, as well as avoid SQL injection) you need to do the whole binding of variables thing I show above.
Otherwise there's not much point.
Domenik Steckling wrote:I am very new to the database swing stuff ...
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
i cant output all of them
Don't get me started about those stupid light bulbs. |