Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6798639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:45:16+00:00 2026-05-26T18:45:16+00:00

What will the command Class.forName(oracle.jdbc.driver.OracleDriver) exactly do while connecting to a Oracle database? Is

  • 0

What will the command

Class.forName("oracle.jdbc.driver.OracleDriver")

exactly do while connecting to a Oracle database? Is there an alternate way of doing the same thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:45:17+00:00Added an answer on May 26, 2026 at 6:45 pm

    It obtains a reference to the class object with the FQCN (fully qualified class name) oracle.jdbc.driver.OracleDriver.

    It doesn’t "do" anything in terms of connecting to a database, aside from ensure that the specified class is loaded by the current classloader. There is no fundamental difference between writing

    Class<?> driverClass = Class.forName("oracle.jdbc.driver.OracleDriver");
    // and
    Class<?> stringClass = Class.forName("java.lang.String");
    

    Class.forName("com.example.some.jdbc.driver") calls show up in legacy code that uses JDBC because that is the legacy way of loading a JDBC driver.

    From The Java Tutorial:

    In previous versions of JDBC, to obtain a connection, you first had to initialize your JDBC driver by calling the method Class.forName. This methods required an object of type java.sql.Driver. Each JDBC driver contains one or more classes that implements the interface java.sql.Driver.
    …
    Any JDBC 4.0 drivers that are found in your class path are automatically loaded. (However, you must manually load any drivers prior to JDBC 4.0 with the method Class.forName.)

    Further reading (read: questions this is a dup of)

    • What purpose does Class.forName() serve if you don't use the return value?
    • How does Class.forName() work?
    • What does 'Class.forName("org.sqlite.JDBC");' do?
    • What is the purpose of 'Class.forName("MY_JDBC_DRIVER")'?
    • Loading JDBC driver
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a SQL command that will list all the tables in a database
Is there a Windows command that will output the size in bytes of a
Is there a command which will print the path of the file in the
I am trying to a create a command class hierarchy. Basically each command will
Is there a command that will stop the execution of my program? I have
Which command will executed first,If a stored procedure have individual multiple select commands;
Following command will let me know the names of databases. $ mysqlshow But how
I want to use ADO.NET Prepare command will increase performance if query is repeatevely
I have Ubuntu Linux. I found one command will let me download unread message
An NTFS directory is open in a bash shell. what command will recursively truncate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.