Use Netbeans to operate MySQL Databases

Source: Internet
Author: User
Tags netbeans

During development, we often use databases for various operations. Due to the support of the Netbeans integrated development environment for various mainstream databases, our developers can easily use Netbeans for project development, saving a lot of time and convenience.

First, make sure that netbeans and mysql are installed on the computer. I am using netbeans6.5 and mysql5.1. You can download the latest version from sun's official website. (Netbeans: http://www.netbeans.org/mysql: http://www.mysql.com /)

1. Add the mysql database driver

Start the netbeans development tool and expand the databases database node in the services service window. You can see a database resource manager, such:

The Drivers package contains all the database Drivers. To use netbeans to operate mysql, you must add the mysql driver here and right-click the Drivers driver) node, then select "New Dirver... "command to open a new JDBC driver form, such:

In this new dialog box select add (add) button, select the driver you want to add mysql database driver mysql-connector-java-3.1.3-beta-bin.jar), after adding OK netbeans will automatically fill in Drivers Class :( com. mysql. jdbc. driver) and Name text input box, and then click OK to complete the configuration of the database Driver on netbeans.

2. Connect to the mysql database through netbeans

After all the above work is done, we can use netbeans as the mysql client to operate the mysql database. Right-click the databases database node and select "new connection... "(create a connection)" option, the following interface is displayed, where name (name) is the name of the database driver configured above, host) is the computer name or IP address of the mysql database, port is the port number of mysql. The default value is 3306. database is the name of the database to be connected, for example, the database established by yang.) enter the database username and password, and click OK) button. For details, refer:

After that, a new database is added under the database node, right-click it, and select connect). the mysql database to be connected will be opened. For example:

Here, Tables is the table created in the yang database, Views is the view, and procedures is the stored procedure. Here we can intuitively see the structure of the database, you can perform various operations on the mysql database through netbeans.

3. Database Operations

To view the data in the person table, right-click "person" and choose "view data"> "view data". The combined form is displayed immediately. The SQL editor is shown above. The data display box is shown below, for example:

Here we can clearly see that the person table has two pieces of data. Of course, we can also write SQL statements in the preceding SQL editor to query the data we need, here, we can perform a lot of operations on mysql database functions under the command line.

  1. Solution to the problem that the font Netbeans6.5.1 under Ubuntu9.04 cannot resist sertiation
  2. Problems with JPA inheritance classes in NetBeans 6.1
  3. How to connect to the MySQL database in NetBeans
  4. Use NetBeans and Eclipse to develop PHP applications
  5. The NetBeans cooperation system is becoming increasingly mature. Third-party support is gradually increasing.

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.