- JDBC 4.0 and Oracle JDeveloper for J2EE Development
- Deepak Vohra
- 183字
- 2021-08-25 18:08:44
DriverManager Class
The DriverManager
class is used to obtain a connection with a database. A JDBC driver is required to be loaded before obtaining a connection with the database. In JDBC 3.0, a JDBC driver can be loaded either by specifying it in the jdbc.drivers
system property, or by using the Class.forName()
method. We require invoking the Class.forName()
method by loading the Oracle JDBC driver, oracle.jdbc.OracleDriver
, using JDBC 3.0.
Class.forName("oracle.jdbc.OracleDriver");
In JDBC 4.0 specifications, the DriverManager
class has added support to getConnection()
and getDrivers()
methods, for the Java SE (Service Provider) mechanism. By using these methods, JDBC drivers may be loaded automatically. The Class.forName()
method is not required to be invoked. Loading drivers using the Java SE Service Provider mechanism will be discussed in the Automatic SQL Driver Loading section.
A JDBC connection is represented by a java.sql.Connection
object, and may be obtained from a DriverManager
by calling the overloaded static getConnection()
methods. The getConnection()
method is listed in following table:

For example, a connection with the Oracle database may be obtained as shown below:
String url="jdbc:oracle:thin:@localhost:1521:ORCL"; Connection connection = DriverManager.getConnection(url, "oe", "pw");
- 3ds Max 2014標準教程(全視頻微課版)
- 中文版CorelDRAW 2022基礎教程
- 做合成:Photoshop構圖+透視+紋理+造型+調色技術修煉
- Maya 2019三維動畫基礎案例教程
- After Effects CC 2019 影視后期特效合成案例教程
- UG NX 9.0中文版基礎與實例教程
- Photoshop CC從入門到精通(全彩超值版)
- Unity 3D\2D手機游戲開發:從學習到產品(第4版)
- Photoshop網店美工實例教程(第2版 全彩微課版)
- Photoshop電商設計與產品精修實戰(微視頻版)
- Python 3 Object Oriented Programming
- Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook
- Learning Ext JS
- Science Teaching with Moodle 2.0
- Joomla! 1.5 JavaScript jQuery