"Learn English from API"-drivermanager

Source: Internet
Author: User
Tags java se

Original:

The basic service formanaging a set of JDBC drivers. Note:the DataSourceInterface,NewIn the JDBC 2.0API, provides another-to-connect to a data source. The use of a DataSource object was the preferred means of connecting to a data source. As part of its initialization, the DriverManagerclassWould attempt to load the driver classes referenced in the ' Jdbc.drivers ' system property. This allows a user to customize the JDBC Drivers used by their applications. For example in your ~/.hotjava/properties file you might specify:jdbc.drivers=Foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriver The DriverManager methods getconnection and Getdrivers have been enhanced to support the Java standard Edition Service Provider mechanism. JDBC4.0 Drivers must include the file Meta-inf/services/java.sql.driver. This file contains the name of the JDBC drivers implementation of Java.sql.Driver. For example, to load the My.sql.Driverclass, the meta-inf/services/java.sql.Driver file would contain the Entry:my.sql.Driver applications no longer need to explictly load JDBC Driver s using Class.forName (). Existing programs which currently load JDBC drivers using Class.forName () wouldContinueTo work without modification. When the method getconnection is called, the DriverManager would attempt to locate a suitable driver from amongst those Loa Ded at initialization and those loaded explicitly using the same classloader as the current applet or application. Starting with the Java2 SDK, Standard Edition, version 1.3, a logging stream can is set onlyifThe proper permission has been granted. Normally This'll is done with the tool Policytool, which can be used to grant permission Java.sql.SQLPermission "Setlog".

Translation:

Basic service for managing a set of JDBC drivers Note: The DataSource interface is another way to connect to a data source after JDBC2.0. Using the DataSource interface is the preferred way to connect to a data source. As part of the initialization, the DriverManager class will attempt to load a driver class that references the "Jdbc.driver" system property. This allows the user to customize the JDBC driver that is used by their own applications. The methods in Drivermanger getconnection and getdrivers have been enhanced to support Java SE. The JDBC4.0 driver must contain the file meta-inf/services/1.3 Start, a log stream can be set (only if the appropriate permissions have been authenticated). Normally these are handled by Policytool, which is often used to authenticate permissions

"Learn English from API"-drivermanager

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.