title: Data not being displayed correct in table, JavaFx using SQLite
body: <p>I am attempting to display the data stored within my database (sqlite), I can retrieve the data but it displays its datatype before it! For example instead of displaying "1" it displays "IntegerProperty [Value: 1]"</p>
  
  <p><a href="https://i.stack.imgur.com/TplPL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TplPL.png" alt="enter image description here"></a></p>
  
  <p>Here is a picture of the database (the table called "Records"):
  <a href="https://i.stack.imgur.com/bPaI7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bPaI7.png" alt="enter image description here"></a></p>
  
  <p>Here is a picture of the project structure:
  <a href="https://i.stack.imgur.com/FWDcF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FWDcF.png" alt="enter image description here"></a></p>
  
  <p>Here is the controller class:</p>
  
  <pre><code>
  import java.net.URL;
  import java.util.ResourceBundle;
  import java.sql.Connection;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  
  import db.dbConnection;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import javafx.scene.control.TextField;
  import javafx.scene.control.cell.PropertyValueFactory;
  
  public class mainController implements Initializable {
  
      @FXML
      private TableColumn&lt;RecordData, String&gt; ncol;
  
      @FXML
      private TableColumn&lt;RecordData, Double&gt; pcol;
  
      @FXML
      private TextField artist;
  
      @FXML
      private TextField year;
  
      @FXML
      private TextField rating;
  
      @FXML
      private TableColumn&lt;RecordData, String&gt; gcol;
  
      @FXML
      private TableColumn&lt;RecordData, String&gt; acol;
  
      @FXML
      private TableColumn&lt;RecordData, Integer&gt; idcol;
  
      @FXML
      private TextField price;
  
      @FXML
      private TextField name;
  
      @FXML
      private TextField genre;
  
      @FXML
      private TableColumn&lt;RecordData, Integer&gt; rcol;
  
      @FXML
      private TextField id;
  
      @FXML
      private TableView&lt;RecordData&gt; recordTable;
  
      @FXML
      private TableColumn&lt;RecordData, Integer&gt; ycol;
  
      private db.dbConnection connection;
      private ObservableList&lt;RecordData&gt; data;
  
      @FXML
      void add(ActionEvent event) {
          String sqlin = "INSERT INTO Records(ID,Name,Artist,Year,Genre,Price,Rating) VALUES(?,?,?,?,?,?,?)";
          try {
              Connection conn = connection.getConnection();
              PreparedStatement ps = conn.prepareStatement(sqlin);
              ps.setInt(1, Integer.parseInt(this.id.getText()));
              ps.setString(2, this.name.getText());
              ps.setString(3, this.artist.getText());
              ps.setInt(4, Integer.parseInt(this.year.getText()));
              ps.setString(5, this.genre.getText());
              ps.setDouble(6, Double.parseDouble(this.price.getText()));
              ps.setInt(7, Integer.parseInt(this.rating.getText()));
              ps.execute();
              conn.close();
          }
          catch(Exception e) {
              e.printStackTrace();
          }
      }
  
      @FXML
      void clear(ActionEvent event) {
  
      }
  
      @FXML
      void load(ActionEvent event) {
          try {
              Connection conn = connection.getConnection();
              this.data = FXCollections.observableArrayList();
              ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM Records");
              while(rs.next()) {
                  this.data.add(new RecordData(rs.getInt(1),rs.getString(2),rs.getString(3),rs.getInt(4),rs.getString(5),rs.getDouble(6),rs.getInt(7)));
              }
          }
          catch(Exception e) {
              e.printStackTrace();
          }
          this.idcol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, Integer&gt;("ID"));
          this.ncol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, String&gt;("Name"));
          this.acol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, String&gt;("Artist"));
          this.ycol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, Integer&gt;("Year"));
          this.gcol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, String&gt;("Genre"));
          this.pcol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, Double&gt;("Price"));
          this.rcol.setCellValueFactory(new PropertyValueFactory&lt;RecordData, Integer&gt;("Rating"));
  
          this.recordTable.setItems(null);
          this.recordTable.setItems(this.data);
      }
  
      public void initialize(URL url, ResourceBundle rb ) {
          this.connection = new dbConnection();
      }
  
  }
  </code></pre>
  
  <p>And here is the recorddata class:</p>
  
  <pre><code>
  import javafx.beans.property.DoubleProperty;
  import javafx.beans.property.IntegerProperty;
  import javafx.beans.property.SimpleDoubleProperty;
  import javafx.beans.property.SimpleIntegerProperty;
  import javafx.beans.property.SimpleStringProperty;
  import javafx.beans.property.StringProperty;
  
  public class RecordData {
  
      private IntegerProperty ID;
      private StringProperty Name;
      private StringProperty Artist;
      private IntegerProperty Year;
      private StringProperty Genre;
      private DoubleProperty Price;
      private IntegerProperty Rating;
  
      public RecordData(int id, String name, String artist, int year, String genre, double price, int rating) {
          this.ID = new SimpleIntegerProperty(id);
          this.Name = new SimpleStringProperty(name);
          this.Artist = new SimpleStringProperty(artist);
          this.Year = new SimpleIntegerProperty(year);
          this.Genre = new SimpleStringProperty(genre);
          this.Price = new SimpleDoubleProperty(price);
          this.Rating = new SimpleIntegerProperty(rating);
  
  
      }
  
      public IntegerProperty getID() {
          return ID;
      }
  
      public void setID(IntegerProperty iD) {
          ID = iD;
      }
  
      public StringProperty getName() {
          return Name;
      }
  
      public void setName(StringProperty name) {
          Name = name;
      }
  
      public StringProperty getArtist() {
          return Artist;
      }
  
      public void setArtist(StringProperty artist) {
          Artist = artist;
      }
  
      public IntegerProperty getYear() {
          return Year;
      }
  
      public void setYear(IntegerProperty year) {
          Year = year;
      }
  
      public StringProperty getGenre() {
          return Genre;
      }
  
      public void setGenre(StringProperty genre) {
          Genre = genre;
      }
  
      public DoubleProperty getPrice() {
          return Price;
      }
  
      public void setPrice(DoubleProperty price) {
          Price = price;
      }
  
      public IntegerProperty getRating() {
          return Rating;
      }
  
      public void setRating(IntegerProperty rating) {
          Rating = rating;
      }
  
  
  </code></pre>
  
  <p>If anyone knows how to get just the value and not the "IntegerProperty [Value: 1]" part, then please help me!</p>