I have a relatively simple program where I'm trying to display values from a 2 column mySql table into a TableView in
Java. My program is getting choked up with an error that says
"java: incompatible types: java.lang.String cannot be converted to int."
My setup is as follows:
I've created a separate Java class that creates an object with 2 variables (brandId and brandName) called "Brand"
I have another Java class called "DatabaseHandler" that has all the code that interacts with the mySql database. In that code I have the following method that is supposed to connect to mySql database table called "dim_brand," retrieve all values, and populate them in an ObservableList that I will use to populate the TableView.
In
testing and debugging the code, I've gotten the connection to the database to succeed and I've be able out sout the results. My program is choking on the statement:
I have no idea why since I'm able to use the getString() method in the sout statement without any issue. I'm thinking it has something to do with the ObservableList<Brand> that I'm trying to insert the values into. Any help our insight would be greatly appreciated.
View of mySql table dim_brand:
brand_id: VARCHAR10
brand_name: VARCHAR45
brand_id | brand_name |
---|
JONMURPHY | Johnston & Murphy |
JOSABANK | Jos A Bank |
NIKE | Nike |
TOMJAMES | Tom James |