Problem one: When using MySQL to query and return a result set, it is true that the statement interface and the PreparedStatement object are known to the small partners. The problem comes, sometimes unexpectedly can not query, debug in, found the execution of SQL statement is garbled,
1. OK first solve garbled, find MyEclipse Open File location Add "-dfile.encoding=utf-8" to the "Myeclipse.ini" file. Again debugging, you will find that the problem is not solved, but brings new problems, such as you enter "Xiao Ming", then in the execution of SQL statements in the incoming is "Xi Xiao Ming", so of course, can not find out the results. Thought it was "Java driver package" problem, I Installed "Mysql-connector-java-5.1.44-bin.jar", later ruled out this possibility. Originally is the MySQL database version problem, I originally installed is: Mysql-5.5.54-win32.msi version, later changed the Mysql-5.7.17.0.msi version, this problem is gone. But the drawback is that the new problem comes again: code as follows, more than the red hint below, have the great God know why?
Please login first, please enter the name of the pet owner:
Xiao ming
Please enter the password for your account:
123456
Sat Oct 17:14:00 CST warn:establishing SSL connection without server ' s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must is established by default if explicit Opti On isn ' t set. For compliance with existing applications not using SSL, the Verifyservercertificate property was set to ' false '. You need either to explicitly disable SSL by setting Usessl=false, or set usessl=true and provide truststore for server CE Rtificate verification.
Landing Success!
Your basic information *************
Name: Xiao Ming
Number of ingot: 178
Login successful, you can buy and sell pets, buy Please enter 1, sell Please enter 2:
1: Buy a pet
2: Selling Pets
Eighth. Some problems about SQL query error