Very new to Java programming, trying to teach myself with tutorials and examples scoured from the web, but I'm having trouble with inserting data from an ObservableList into a MySQL database.

I have a TableView backed by an ObservableList. I'm not sure if I'm saying this correctly (again, new to programming), but each row of my ObservableList has 8 cells (Integer, Integer, Double, Double, Boolean, String, String, Double), of which I need to insert the first 5 into my SQL database. All the examples I find for ObservableList are how to get data INTO the list, and all the SQL Insert examples I find use insert statements with no variables:

JDBC - Insert Records Example "VALUES (101, 'Mahnaz', 'Fatma', 25)"
JDBC Statement example – Insert a record “VALUES (1,'mkyong','system', " + "to_date('")”

Even with a Prepared Statement example (JDBC PreparedStatement example – Insert a record) the example uses data typed in the code itself:

    String insertTableSQL = "INSERT INTO DBUSER"
		+ "(USER_ID, USERNAME, CREATED_BY, CREATED_DATE) VALUES"
		+ "(?,?,?,?)";
 
		try {
			dbConnection = getDBConnection();
			preparedStatement = dbConnection.prepareStatement(insertTableSQL);
 
			preparedStatement.setInt(1, 11);
			preparedStatement.setString(2, "mkyong");
			preparedStatement.setString(3, "system");
			preparedStatement.setTimestamp(4, getCurrentTimeStamp());
 
			// execute insert SQL stetement
			preparedStatement.executeUpdate();

(why I would ever use a preparedStatement to insert one non-dynamic record I'll never understand).

The closest I come to figuring this out gets me a pointer to the object (row), but I can't figure out how to get the DATA out of that row object and pass it to the database:

    for (DataModel dm : datalist) {
        System.out.println("The next item is: " + dm);
    }
Running this (obviously) gets me a readout like:

The next item is: package.GUIController$DataModel@770d8fe9
The next item is: package.GUIController$DataModel@1b63470f
The next item is: package.GUIController$DataModel@12ce37d5
Which coincides well with the fact that in my test run I added three rows of data to my TableView (backed by DataModel).

So if I understand what I've done, then each of these objects (@770d8fe9, @1b63470f and @12ce37d5) contain 8 pieces of data (which seems to be working correctly, since the TableView is populating correctly). Of these 8 pieces of data I need to extract the first 5 to insert into my database. I was hoping my next step would be something like:

    Integer first = dm.getInteger(1);
    Integer second = dm.getInteger(2);
    Double third = dm.getDouble(3);
...etc. I actually tried something similar to this and got an error once I passed the number three. I don't remember the exact error, but it was something that made me think I had gone beyond the end of the list, which makes me think it was getting the row rather than the cell within that row. If I could do something like this, then I could surround that with a prepared statement for the actual INSERT.

    preparedStatement.setInt(1, first);
... etc. But I cannot for the life of me figure out how to do this part.

Can anyone please tell me (or put a link to an already existing tutorial or sample code that shows) how to extract data from my ObservableList and insert it into my MySQL database?

Thank you very much in advance.