i'm new to SQL and Java and couldn't find anything to fix my problem. (closest thing: MySQL query based on user input) So I have a DB full of shows/events and I want users to "search" for a certain event or show. The user will input the name of the show/event into GUI and I want the query to return data associated with the user-input.
For example:
User is searching for the artist Zedd;
searchSet = statement.executeQuery("SELECT eventname,date FROM shows WHERE artist LIKE 'zedd' ");
The query is fixed, can the query be modified to search whatever the user input?
Something like:
String artist = "zeppelin"
searchSet = statement.executeQuery("SELECT eventname,date FROM shows WHERE artist LIKE "artist" ");
Thanks in advance for the help!