Application development: Java: Thermal constant

Source: Internet
Author: User
Tags constant db2 db2 driver

So far, perhaps you've read a lot about DB2 9 for Linux, Unix, and Windows (formerly code-named "Viper"), the hybrid engine that facilitates integration of XML data and relational data. You may also have read about the DB2 9 features that can speed up application development. In this article, I'll describe some of the new features that are more important for developing Java applications.

Java 5.x Support

DB2 9 now supports Java 5.x on many platforms. The Java 5.x introduces a number of new and enhanced features, including support for Unicode patches, enhanced for loops, generics, type-Safe enumeration types, variable parameters, and more. These features can be leveraged when developing Java applications and Java routines for DB2.

DB2 Driver for JDBC and SQLJ

In DB2 9, DB2 Driver for JDBC and SQLJ is now the default driver for Java applications. The DB2 JDBC Type 2 driver is not recommended, and the DB2 JDBC Type 3 driver has been discarded. If you want to use DB2 Driver for JDBC and SQLJ as the default driver supported by the Java routine runtime, you can set the DB2 registry variable to Db2_use_db2jcct2_jroutine=on. (This registry variable is not set by default.) )

DB2 Driver for JDBC and SQLJ compliant with the JDBC 3.0 specification, released with DB2 91. This driver includes support for new XML column data types, XQuery, new updates and methods for retrieving data in XML columns, and stored procedure calls with XML parameters. It also includes new DB2 methods for registering XML schemas and establishing trusted connections.

DB2 9 supports the use of XML in JDBC and SQLJ applications and routines. IBM Universal JDBC Driver supports the use of XML data in query and Java applications and routines in input and output parameters through a com.ibm.db2.jcc.DB2Xml private interface.

Currently, the native XML classes are not included in the JDBC standard. Therefore, in DB2 9, XML columns are mapped to Java strings, byte arrays, streams, and new COM.IBM.DB2.DB2XML classes. To insert and update XML columns, you can use any of the method names listed in table 1 and the corresponding input data types.

You can retrieve XML data from an XML column by using a string, a byte array, a stream, or a dedicated com.ibm.db2.jcc.DB2Xml type. You can use the ResultSet or Db2xml methods to retrieve data. The difference between the ResultSet method and the Db2xml method is that some Db2xml methods add coding instructions to the output data. Specifically, the Db2xml.getdb2xmlxxx method adds an XML declaration to the output data, including an encoding description, while the Db2xml.getdb2xxx method does not. Table 2 shows the method name, the corresponding output data type, and the encoding description.

Let's take a look at some examples of running on the DB2 sample database, which should be created in Unicode so that these examples can store XML data. All the scripts and other files required to run these examples are installed on the operating system together when DB2 9 is installed. To convert an existing sample database to Unicode so that you can use current relational data and new examples of XML data, follow the publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp? Description in the topic=/com.ibm.db2.udb.admin.doc/doc/t0024033.htm.

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.