A summary of Java technology Implementing database application System

Source: Internet
Author: User
Tags odbc

The Java language is an object-oriented programming language-oop (ABBR), which was officially named and launched by Sun Microsystems in 1995. Object oriented programming). "The Java programming language is designed by the programmers for programmers, which is popular with the development of the Internet," Sun said. The development of the system "one development, running everywhere" characteristics and the design of the program development of the object-oriented thinking deeply touched people. It has the features of simplicity in language, large variety of programming languages, and object-oriented, portability, distribution, security and high performance. Java in the internet/intranet, and even the computer world in all areas of infiltration, slowly changing people's thinking. Now the internet heat wave over a wave, from the outside world into the enterprise internal formation intranet, promote the use of Java technology development. IBM, oracal, Apple, Sun, and Netscape five companies in the computer industry also jointly launched the "Network computer (NC-1)" specification. Put aside the bloated architecture of "Wintel", making it inexpensive, easy to use, and a simple computer-nc (network Computer) that can connect to the network, the so-called "thin customer" machine, NC support Java Virtual Machine (JVM), The ability to run Java-developed applications (application) and applets and support multimedia applications. The combination of NC and Java has created a new era: the Internet computer age. Even the sun's enemies, Microsoft's Bill Gates, has to admit: "Java is the most outstanding programming language for a long time."

Java Database Infrastructure JDBC API

Java language in the database application, especially in the web based on B/s structure of the online database application of cumbersome complex configuration, and can not use the user and program development both sides are very satisfied. Sunsoft provides Java and database interface specification in Java language JDBC (Java database connectivity, while JavaSoft says JDBC does not mean anything), so that Java programs can pass the Unified Standard specification JDBC APIs to communicate with different databases. Ensure a "100% pure Java" solution. The JDBC API defines classes and interfaces in Java, representing database connections, SQL directives, result sets, and so on. It allows Java programmers to send SQL instructions and process the results. The JDBC API provides two main interfaces: A developer-oriented java.sql package that enables Java programmers to make database connections, execute SQL queries, and get a result set. The JAVA2 java.sql package provides 6 classes and 18 interfaces, described below, and the other is JDBC Drivers for the underlying database vendor, and so far Java2 JDBC Drivers offers only the following four types of database drivers, each with its own pros and cons:

(1) JDBC-ODBC Bridge Plus ODBC driver mode: JDBC-ODBC Bridging method using Microsoft's Open Database Interconnect interface (ODBC API) to communicate with the database server, the client computer should first install and configure ODBC driver and Jdbc-odbc bridge two kinds of drivers. This is the most likely solution to applets access to your database, but this is a very annoying and troublesome solution for both the Internet and intranet users.

(2) Native-api partly Java driver method: This drive method converts the special protocol of database manufacturer into Java code and binary class code, so that the Java database client communicates with the database server side. For example: Oracle uses the Sqlnet protocol, DB2 with IBM's database protocol. Special protocols for database vendors should also be installed on the client. It's also a nasty and troublesome solution.

(3) Jdbc-net Pure Java driver method: This is a pure Java driver. The database client communicates with the database access server in a standard network protocol (such as HTTP, Shttp), and the database access server then translates the standard network protocol into the database vendor's proprietary special Database Access Protocol (and possibly ODBC driver) to communicate with the database. This is an ideal solution for both the Internet and intranet users. The Java driver is automatically downloaded and installed on the user's computer with applets from the Web server in a transparent manner.

(4) Native-protocol Pure Java driver method: This is also a pure Java driver. The database vendor provides a special JDBC protocol for Java database clients to communicate with the database server. However, the agent protocol will be switched to the database server for the special JDBC driver of the database vendor. This is efficient for intranet applications, but the database vendor's protocol may not be supported by firewalls, and the lack of firewall support can potentially be a security risk in Internet applications.

In four ways, only the third to fourth way drivers support the applet's 0 installation. Because the JDBC drivers is written entirely in Java and is downloaded from the Web server with the applet. In order to support the 0 installation, the driver should be placed on the web and in the same directory as the applet. The fourth kind of security hidden danger, the third product is few, now more mature IDs JDBC driver belong to this kind of (http://www.idssoftware.com), but also use ODBC driver auxiliary.

Even so, using Java technology to develop stand-alone environment applications, LAN-wide or Intranet-environment applications, dynamic Web applications (live Intranet), the Java language is efficient, secure, and stable. The Java language has won the support of many vendors, based on its Java API-JDBC also developed rapidly. Sun promises that any Java applets or Java applications can be combined with databases and will continue to spare no effort to support future Java technology development. The cross-platform nature of the Java language makes it an ideal choice for developing database application systems in the Internet and intranet environments.

Second, Java database application development Prospect

At this point, you know that the design of Java database applications requires a wide range of skills, including knowledge or proficiency in database drivers, SQL (Structured Query language), and the classes, interfaces, and java.sql packages. JavaSoft has noted the thorny complexities of Java in database program design, and they are now developing new, Easy-to-use products javablend that will greatly simplify the process of building database applications using JDBC. Javablend automatically mirrors the Java object as information stored in the database. All operations on the object will produce the action of the database that is mirrored, including automatic query and update of the information stored in the database. Once Java objects to database mirroring (Java object-to-database Mapping) are successfully built, Javablend will be distributed to Java programmers free of charge, allowing Java programmers to take advantage of tedious SQL statements, The result collection solution transitions to a simple solution that uses javablend to automatically translate method calls for Java objects into SQL statements and result sets. This will make JDBC and SQL knowledge unnecessary for database development, and allow programmers to focus on the delivery of user business solutions. Javablend is not currently included in JDK 1.2.

The Java language and its technology are the mainstream of programming languages in the world today. Application of Java technology to implement database application system is the future development direction, Java database application has been successfully applied to business, government and universities and other fields, the application has just started. I believe that in the near future, Java technology will be more sophisticated and mature. Java's database applications will also be everywhere.

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.