Example of connecting database and fuzzy query function realized by Java

This paper describes the connection database and fuzzy query function realized by Java. Share with you for your reference, as follows:

Fuzzy query is a common query method. For example, the order table contains the specific date of the order. If you want to query the order information of a year and a month, the best way is to use fuzzy query. The keyword like is required for fuzzy query. When using the like keyword for fuzzy query, you can use the wildcard "%" instead of 0 or more characters and underline_ To represent a character.

Note: it should be noted that when using like, the following query conditions need to be enclosed in single quotation marks in English, otherwise the error is reported as follows

You have an error in your sql Syntax; Check the manual that responses to your MySQL server version for the right syntax to use near '%' at line 1

Operation results:

Readers interested in more Java related content can view the special topics of this site: summary of java + MySQL database programming, tutorial on Java data structure and algorithm, summary of java file and directory operation skills, summary of Java DOM node operation skills and summary of Java cache operation skills

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>