Note that there are some explanatory texts on larger screens.

plurals
  1. POInterpreting data strings and inserting it into a JTable in the correct column positions in Java
    text
    copied!<p>I'm concerned about my Java client directly connecting to the MySQL server due to all of the issues that could occur, and the security risks I believe it could pose. Such as someone being able to decompile the file and get the login details for the database. As beautiful as it would be, I'm too scared to take that risk. I've written a PHP script to echo data that the client can interpret. The PHP script is what connects to the MySQL.</p> <p>It's rather simple: Java->PHP->MySQL</p> <p>I'm going to provide screenshots of the MySQL structure, so you may better understand when trying to visualize this. <img src="https://i.stack.imgur.com/gZWGk.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/RA73E.png" alt="http://i.imgur.com/5EViC.png"> <img src="https://i.stack.imgur.com/kLNJl.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/RJ9YN.png" alt="enter image description here"></p> <blockquote> <p>id: possibly tid/sid</p> <p>tid: teacher id, used to link to the teacher</p> <p>sid: student id, used to link to the student</p> <p>gid: grade id</p> <p>aid: assignment id</p> <p>gp: gained points</p> <p>pp: possible points</p> </blockquote> <p>Grading rows are for each assignment per student. So for example if a teacher had 30 students assigned to one assignment, there would be 30 rows in the grading tab and one in the assignments. Duplicate assignment names are NOT allowed.</p> <p>When the client is requesting the data, I just use a buffered reader &amp; URL to download the string. This is the example output of when the client receives the assignment names.</p> <pre><code>Test Assignment;Secondary Test Assignment; </code></pre> <p>This is what it looks like to the client once the column names are downloaded: <img src="https://i.stack.imgur.com/qwxF7.png" alt="enter image description here"></p> <p>As you can see the first two columns are there by default, the last two are assignment names.</p> <p>I want each row in the table to be a student. However, here is where my trouble comes in. I'm trying to receive the proper data from grading. I don't know how I'm going to do this. I have about 3 months experience with Java, so you could definitely call me a newbie.</p> <p><strong>Here is my idea, but I didn't think it was so great of an idea:</strong> <em>Search through all of the column names and insert the value into the proper column in that row where assignment name matches.</em></p> <p>I didn't know how difficult that would be. I'm guessing the nice people who developed swing built something in for that, but I can't find any resources. </p> <p>Does anyone have any recommendations on what to do in this situation? I feel lost.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload