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 8723075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:32:44+00:00 2026-06-13T07:32:44+00:00

This is my first attempt to connect to an Oracle DB (10g) using JDBC.

  • 0

This is my first attempt to connect to an Oracle DB (10g) using JDBC. I have JDK 6 installed on my machine and trying to connect to an Oracle DB on a server. I have downloaded ojdbc6.jar and copied it to C:\oracle\product\10.2.0\client_1\jdbc\lib.

I have also set the following CLASS PATH:

.;
C:\;
C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc6.jar;
C:\oracle\product\10.2.0\client_1\jlib\orai18n.jar;
C:\Program Files\QuickTime\QTSystem\QTJava.zip

The following code gets compiled, however when I try to run the class file, it throws an error

C:\>java JDBCVersion
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at JDBCVersion.main(JDBCVersion.java:10)

I save my .java files in C:\ to compile and run from this directory.

import java.io.*;
import java.sql.*;

class JDBCVersion
{

  public static void main (String args[]) throws SQLException{
  try{
  Connection con=null;
      Class.forName("oracle.jdbc.driver.OracleDriver");
      con=DriverManager.getConnection(
      "jdbc:oracle:thin:@HOSTNAME:1521:MYORADB",
        "SCOTT",
        "TIGER");
      Statement s=con.createStatement();
      s.execute("SELECT * FROM EMPLOYEE");
      s.close();
      con.close();
   } catch(Exception e){e.printStackTrace();}
   }
 }

@dardo…I added the .jar file directly in the CLASSPATH and it compiled but when I run the class file I get the following error message

C:\>java JDBCVersion
Exception in thread "main" java.lang.NoSuchMethodError: oracle.i18n.text.convert
er.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;
        at oracle.sql.converter.CharacterConverterFactoryOGS.make(CharacterConverterFactoryOGS.java:43)
        at oracle.sql.CharacterSetWithConverter.getInstance(CharacterSetWithConverter.java:97)
        at oracle.sql.CharacterSetFactoryThin.make(CharacterSetFactoryThin.java:129)
        at oracle.sql.CharacterSet.make(CharacterSet.java:514)
        at oracle.jdbc.driver.DBConversion.init(DBConversion.java:169)
        at oracle.jdbc.driver.DBConversion.<init>(DBConversion.java:120)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1135)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at JDBCVersion.main(JDBCVersion.java:15)
  • 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-06-13T07:32:44+00:00Added an answer on June 13, 2026 at 7:32 am

    Executing with the following command should get it to run.

    java -jar -classpath .;C:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc6.jar;C:\oracle\product\10.2.0‌​\client_1\jlib\orai18n.jar;C:\Program Files\QuickTime\QTSystem\QTJava.zip; jarName.jar
    

    But, you might want to look into packaging these jars with your executable rather than setting the classpath.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this if my first attempt at using streaming for WCF, and I am struggling
I'm trying to create a simple threading procedure (granted this is my first attempt
This is my first attempt at doing roles for asp.net, what I have is
This is my first attempt at using Backbone.js, so I decided to make a
This is my first attempt at responsive design, so I'm keeping it simple. I
This is my first attempt to write shorthand if statements however am befuddled by
This is my first attempt to create a GUI in MATLAB. I haven't been
this is my first attempt at a responsive design so excuse me if this
Because this is my first attempt at an extension method that seems quite useful
Up front: This is my first attempt at an Android app. I'm in that

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.