Java data access to MySQL

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.