Ches Starinskis

Greenhorn
+ Follow
since May 01, 2013
Ches likes ...
Python MySQL Database Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ches Starinskis

@Martin Vajsar

Here some example code for you
10 years ago
Hello coderanch Forum users.

I would like to ask couple of questions.

I currently able to get the data from the Database and display it in JTable. In addtion, I would like to update the data in the Database that has been modified in the JTable but I don't know how to do it. I found some of the examples what other people did but they did not work for me.

So my question is this: Does it matter how you getting and storing data from the Database?? I currently using Array of String


to store and pass data from the Database and converting the Array in to the Vector and display the data using a


for my JTable.

I know about different methods that can be used to do it but I don't know which is one is better be useful for my situation.

I will be highly appreciated to get some advice or tutorial.

Thanks.

Ducky

P.S. If any one need a code of the methods I use to get data from the Database I will be happily to post them.

Edit

Here an example of the code I use to get the date from the Database in to the JTable
I using a Client and Server architecture for my application: without a proper networking between them.

Server Class
This method will query the Database and automaticly finds out what data is in the table and stores it in Array of String: You can correct me if I get thet part wrong.


Client Class
Then inside of the Client Class Server Object is created and and uses the getDBGrades() from the Server to store it. Correct me if I'm wrong


Staff GUI Class
Then in GUI Class it creates an object of the Client class and uses it methods to put it to the Vector and insert the data into the JTable using DefaultTableModel

When it all done all data is obtained and displayed on the JTable.
User can edit the data inside of the JTable. In addition, I want to allow send modified data back to the Database but I don't how really do it .

I found some example code how to do it in this forum but did not work for me or don't know how to modify it to my needs.
I can attach or send my project files if needed.

P.S. I'm Student don't have a lot of experiences with Java.
10 years ago