Anonymous asked in Computers & InternetProgramming & Design · 1 decade ago

how to connect to oracle database trough java program?

in my system i have loaded Oracle 9i and set the path in environmental variables like path,classpath.

Buit when i run my jdbc program iam getting exception

Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC driver for Or


at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)

at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)

at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)

at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)

at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at testjdbc.main(

3 Answers

  • Anonymous
    1 decade ago
    Favorite Answer

    Try to read this tutorial:

    But your error seems to be that the name of the main class of your program and the name of the Java file that you have saved your code are different. Also check if the enviroment variables are correctly.

    Source(s): RBM
  • degnan
    Lv 4
    4 years ago

    you decide on a motive force, yet motive force hence does not propose an working device motive force. It skill a Java application that conforms to the Java DataBase Connectivity specification. you will get carry of the motive force from Oracle's website.

  • 1 decade ago

    Have you tried to use the Oracle database connector as the driver? You should use it in connecting to an Oracle database. Different databases have different drivers for Java.

    Check also for some examples on how to connect you java program to a database (be it oracle, mysql, etc.). I hope this helps and goodluck!

Still have questions? Get your answers by asking now.