I am new to JDBC. I have a select query and I need to use a Java variable in where condition. I am trying to use it directly in the query. Can anyone please let me know what needs to be done to use a variable declared in the function.
int x = 10; ResultSet rs = stmt.executeQuery("select * from Table where value=x") ;
What should I do to use variable x in the SQL stmt.