我是靠谱客的博主 洁净电灯胆,最近开发中收集的这篇文章主要介绍如何在java中添加驱动程序,java – 驱动程序类如何位于JDBC4中,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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中所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(44)

评论列表共有 0 条评论

立即
投稿
返回
顶部