i am new to java and started with a simple connection to an oracle database and tried to gather data from the database and place it in a jtable. below is the code that i've used. i can see information in my table, but only the NAME from the select statement is shown, thus meaning the loop is executed once i think? could someone tell me how to solve this issue. thanks, bryan
Either your method name "DisplayRecords" is incorrect as this method does more other things, or your code inside method is incorrect, as it does other things than method name suggests. Please split your method and separate certain things from what you're trying to accomplish with this "DisplayRecords" method.
1. stringCon, uName, uPass, con keep those variables as instance variables with access modifier private and pass as arguments to the method which is described in step "2.".
2. create method to get Connection object, it means it will be separated from the method DisplayRecords where it is not suppose to be.
3. create another method (think about the name of it) to pass as an argument the query and return ResultSet.
4. with the next half of the code you can do the same by creating methods with a only single purpose.
It is good that all this code does not laying down in "main" method, but still, this method is the way too long as it is now. Try always to decompose your code to a small methods (body of the methods could be even 1 line long), so you could reuse small pieces of code in a format of method in other parts of your code.