Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert SimpleStringProperty to String?

I'm using simple string properties in JavaFX, which I need as I cannot change strings within action events. In my SQL I'm using a String variable, in a prepared statement, to search any table. This variable is used to get data out of the correct table.

Can I Change a simple string property into a string or is there another way I can use the simple string property in my SQL statement.

E.G

THIS IS WORKING CODE IF I GAVE A STRING

StringVariable = String

But I have a simplestringproperty

So mine would be

StringVariable = SimpleStringProperty

Which doesent work.

PreparedStatement = " SELECT ?.* " .... further SQL statemet

PreparedStatement.setString(1, StringVariable);
like image 354
Dynermite Avatar asked Mar 15 '26 21:03

Dynermite


1 Answers

Just get the value of the property with

stringVariable.get()
like image 148
James_D Avatar answered Mar 17 '26 12:03

James_D



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!