Finally solved all the difficulties, through the Java program to achieve the MySQL data access, there are many difficulties, especially for a new contact with the JDBC code, each time the error is a bit confusing, while now on some of the problems are still remembered, to help you record.
1. First, with some configuration of the MySQL environment, you need to first learn some basic MySQL syntax, create a new database in MySQL; MySQL syntax: CREATE database if not exists the name of the databases, and then add the data you need to store in it.
2. The second method: adding MySQL syntax to the. SQL text is imported directly from the cmd command prompt; This method feels quicker.
3. Accessing data from a MySQL database through a Java program
The test procedure is as follows:??
Fill in the picture abstract (optional)
The results of the operation are as follows:
Fill in the picture abstract (optional)
? There are some garbled, due to time reasons and did not delve into the MySQL may be added to the data some problems. However, you can basically save access to the data. This is the local data access, there is a remote data access, the next time if you find some of the difficulties to share with you!
Java data access to MySQL