Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009
    Posts
    16
    Rep Power
    0

    Default connectivity problem - oracle10g XE with Java on Vista Home Premium 64 bit

    hi friends

    i am trying to connect oracle with Java on vista 64 bit os...i made DSN by using odbcad32.exe situated in %windir%syswom64/odbcad32.exe file and using Driver for oracle...but while executing the foll proog in java i am getting the error as ORA-06413 connection not open ...

    plz help me...



    Program
    import java.sql.*;
    import java.net.*;
    import java.util.*;
    import java.awt.*;
    public class oracle
    {
    public static void main(String asas[])
    {
    try
    {

    // JOptionPane.showMessageDialog(null," arg1");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newI nstance();
    // JOptionPane.showMessageDialog(null," arg2");
    System.out.println("dsdsd");
    Connection cn=DriverManager.getConnection("jdbc:odbc:proj","s ystem","edison");
    System.out.println("dsdsd2");
    // JOptionPane.showMessageDialog(null," arg3");
    Statement st=cn.createStatement();

    ResultSet rs=st.executeQuery("Select * from candidate ");

    while(rs.next())
    {
    System.out.println(rs.getString("voterid"));
    }
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }
    }



    ERROR

    dsdsd
    java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-06413: Connection not open.
    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(Unknow n Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.main(oracle.java:16)

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    368
    Rep Power
    5

    Default

    What is full path of your 'oracle' class ?

    Are you running this from 'oracle' class
    that is in some directory with a special character in the name or
    an extra dot?

  3. #3
    Join Date
    Dec 2009
    Posts
    16
    Rep Power
    0

    Default rep.

    ya..my class name is "oracle" only...

    and it does not in the directory that hav any invalid char in name..i hav doubt wether this prob is due to 64 bit OS..

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Why are you using the jdbc/odbc bridge? Oracle has a far better driver than that shaky old thing.

  5. #5
    Join Date
    Dec 2009
    Posts
    16
    Rep Power
    0

    Default hi

    then can u plz send me sample code of connecting java with oracle on 64 bit OS.....

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Go to Oracle's site and download the driver from there?
    Then maybe look at Suns tutorial on JDBC.

Similar Threads

  1. Replies: 18
    Last Post: 10-13-2009, 03:00 PM
  2. Replies: 4
    Last Post: 02-04-2009, 03:19 PM
  3. [SOLVED] Problem with socket programming(Vista)
    By jagatsastry in forum Networking
    Replies: 1
    Last Post: 02-02-2009, 03:56 PM
  4. Replies: 0
    Last Post: 02-01-2009, 08:43 AM
  5. Make money from home, Home Typing Data Entry Partnerships
    By arturmoniswork in forum Reviews / Advertising
    Replies: 0
    Last Post: 12-30-2008, 05:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •