public void Search(ActionEvent event)
{
try
{
Connection conn = SqliteConnection.Connector();
PreparedStatement ps = conn.prepareStatement("SELECT FROM Studentlist WHERE ID LIKE ?% ");
ps.setString(1, this.search.getText());
ResultSet rs = conn.createStatement().executeQuery(String.valueOf(ps));
while (rs.next())
{
this.data.add(new StudentData(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6), rs.getString(7)));
}
}
catch (SQLException e)
{
System.out.println(e);
}
}
I am trying to search data by id from the database through tableview javafx gui
i want it to return all the data starting with the letters i input in the textfield
i connected the database through the class and method i created SqliteConnection.Connector();
prepared a string got the value from the search textfield... this.data
is the name of observablelist.. my issue is i dont get any result in the tableview when i type a valid ID