概述
When the method getConnection is called,the DriverManager will
attempt to locate a suitable driver from among the JDBC drivers that
were loaded at initialization and those loaded explicitly using the
same class loader as the current application.
The DriverManager methods getConnection and getDrivers have been
enhanced to support the Java SE Service Provider mechanism (SPM).
According to SPM,a service is defined as a well-known set of
interfaces and abstract classes,and a service provider is a specific
implementation of a service. It also specifies that the service
provider configuration files are stored in the Meta-INF/services
directory. JDBC 4.0 drivers must include the file
Meta-INF/services/java.sql.Driver. This file contains the name of the
JDBC driver’s implementation of java.sql.Driver. For example,to load
the JDBC driver to connect to a Apache Derby database,the
Meta-INF/services/java.sql.Driver file would contain the following
entry:
最后
以上就是洁净电灯胆为你收集整理的如何在java中添加驱动程序,java – 驱动程序类如何位于JDBC4中的全部内容,希望文章能够帮你解决如何在java中添加驱动程序,java – 驱动程序类如何位于JDBC4中所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复