Java Connection to Oracle database

Source: Internet
Author: User

Generally after writing import oracle.jdbc.driver.*; Statement, you will find an error. At this point you need:


First, add the JDBC driver to the Classpath

Two different methods.  One is graphical, computer-Properties-Advanced settings-Environment variables-edit path, add absolute path \JDBC driver name such as C:\jdbc\lib\ojdc6.jar; Here the JDBC driver has a version of the problem.

The second is the CMD command line setting, C:\>set classpath=.; Absolute path name \JDBC driver name


Second, in their own projects to import this driver

Because I am a novice in Java, this is always forgotten, the content of the online search mentioned this is not much.

You need to right-click on your project Riku to import the resource, such as Ojdbc6.jar.

Other similar, do not import, such as when you want to use the Oracle Spatial provided by Sdoapi.jar and Sdoutl.jar, also need to import here, as well as the previous step to add to classpath.

Java Connection to Oracle database

Related Article

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.