Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-27-2010, 06:51 PM
Member
 
Join Date: Dec 2009
Posts: 16
Rep Power: 0
venkateshcoolmoon is on a distinguished road
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("jdbcdbcroj","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)
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-27-2010, 07:28 PM
FON FON is offline
Senior Member
 
Join Date: Dec 2009
Location: Belgrade, Serbia
Posts: 292
Rep Power: 1
FON is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-27-2010, 07:35 PM
Member
 
Join Date: Dec 2009
Posts: 16
Rep Power: 0
venkateshcoolmoon is on a distinguished road
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..
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-28-2010, 09:07 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
Why are you using the jdbc/odbc bridge? Oracle has a far better driver than that shaky old thing.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-28-2010, 01:16 PM
Member
 
Join Date: Dec 2009
Posts: 16
Rep Power: 0
venkateshcoolmoon is on a distinguished road
Default hi
then can u plz send me sample code of connecting java with oracle on 64 bit OS.....
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 01-28-2010, 01:34 PM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
Go to Oracle's site and download the driver from there?
Then maybe look at Suns tutorial on JDBC.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SwingWorker problem. Works in Vista but not in Linux. pellebye New To Java 18 10-13-2009 04:00 PM
how to connect a driver in java for jdbc connections to oracle10g swathi palla New To Java 4 02-04-2009 04:19 PM
[SOLVED] Problem with socket programming(Vista) jagatsastry Networking 1 02-02-2009 04:56 PM
Eclipse failing to start on Vista 64bit Home Prem.. while i got no prob runnin JGrasp kendy Eclipse 0 02-01-2009 09:43 AM
Make money from home, Home Typing Data Entry Partnerships arturmoniswork Reviews / Advertising 0 12-30-2008 06:55 AM


All times are GMT +2. The time now is 09:13 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org