Use Java Applet to access the database

Source: Internet
Author: User
Tags microsoft access database

Use Java Applet to access the database
To learn any programming language, of course, it must be related to the database. When Java was just born, its support for the database was not very good. After several years of development, its support for the database has also completely reached a mature situation. Since Java Applet is introduced here, it is impossible to use a large space to introduce the knowledge of the database and how to create and design the database, please read some books by yourself! I can't help it anymore.
Here we use Microsoft Access database as an example to illustrate how to enable and read a database.
Step 1:
When Microsoft Access is used to create a database, that is, what is used in my example, the content is free.
Step 2: Compile the program.
1) define variables. The variables are defined as follows:
TextArea theVisits = new TextArea (6, 80 );
// Display the database content
TextField theStatus = new TextField ("", 80 );
// Display the information for opening the database. Equivalent to the Program Status Bar
Connection theConnection; // Connection method of the database
Statement theStatement; // represents a database command sent to the database for execution.
ResultSet theResult; // The data read result, that is, the result returned by the database.
ResultSetMetaData theMetaData;
// Contains useful information about the returned results after database command execution.
String theDataSource; // contains the name of the accessed database or data source, expressed in URL format.
String theUser; // User Name of the database
String thePassword; // Database Password

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.