Home>
I want to perform fuzzy search using bind variables
For example
public List<○○>There is a method like searchByName(String keyword) {}.
In this {}, connect to the DB (postgresql this time),
String sql = SELECT * FROM people WHERE name LIKE %?%;
I want to execute the SQL statement with executeQuery(). (Enter the keyword of the argument in?)
But I get an error. Perhaps I don't think? Is recognized as a bind variable...
Please teach if you know how to do it.
Language: Java (ver.8)
Development environment: eclipse
-
Answer # 1
Related articles
- java - i want to perform search evaluation of board games without using recursive expressions
- java - about fuzzy search function of spring boot
- java main method not found using eclipse
- java - i want to extract all the data using cursor
- java - file upload using spring security
- java - updating variables using charat ();
- python - i want to perform clustering using k-means in a specified scatter plot
- ruby - i want to search the data of a nested model using ransack
- ruby on rails - search function using rails jquery does not work
- java - cannot compile using package (mac)
- i want to create a search site using youtube api with ruby on rails
- [java] i want to prohibit input of only blanks using regular expressions
- java - cannot pass data (screen transition) using servlet
- java - cannot search by entering "%" or "_" in the search box
- java - search multiple items about how to write findby 〇 and △ like()
- java - spring boot search function
- i want to create a frame using jframe in java, but it crashes
- java - i want to get the date and time continuously by calculation without using sleep or timer
- java - the image when taking a picture using android studio camera 2 is black
Trends
- python - you may need to restart the kernel to use updated packages error
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to check the type of a shell script variable
- i want to call a child component method from a parent in vuejs
Leave the SQL described in PreparedStatement like ?,
Since there is a% before and after the variable to be bound, is there a problem?