Java SE Database connection operation: accessing the database

Source: Internet
Author: User
Tags mysql java se

For the project development, the database is occupying a very important link.

This section revolves around a program about database operations, including adding, modifying, deleting, and querying (CRUD) operations

Here is the topic of the program: CRUD operations on news headlines.

One. Since it is a news headline, the database table is built into several properties as shown in the following illustration:

The name of the table is named: Firstleveltitle

I'm here using Mysql,mysql to create tables and other uses to see http://zhaoyuqiang.blog.51cto.com/6328846/1127226

Second, create a Java project

Create a Java Project Project news in Eclipse or MyEclipse

Copy the MYSQLJDBC driver package for the application to the project's Lib folder.

Note: MYSQLJDBC is a jar package, can not be uncompressed, the package directly dragged into or copied into the Lib folder will be able to, this package has a database connection to use the things. This package is imported from the outside into eclipse or myeclipse and can be downloaded to the package online. Of course, different databases have different packages, and if it is SQL Server 2005, you should lead the SQLJDBC data jar package.

As shown in the following illustration:

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.