aspose file tools*
The moose likes JDBC and the fly likes not able to connect with 10g Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "not able to connect with 10g" Watch "not able to connect with 10g" New topic
Author

not able to connect with 10g

Inder Kumar Rathore
Ranch Hand

Joined: Apr 14, 2010
Posts: 41
hi I am connecting oracle 10 g but I am not able to connect..
It gives exception java.sql.SQLException

this is my consoles output

E:\Prgm\Rathore>java OracleConnectionUrl
Oracle JDBC driver loaded ok.
Exception: java.sql.SQLException: Listener refused the connection with the follo
wing error:
ORA-12505, TNS:listener does not currently know of SID given in connect descript
or
The Connection descriptor used by the client was:
localhost:1521: orcl


also I am not good in oracle...
please suggest some points.....
thanks


Thanks

Living is easy with your eyes closed.....
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 784

Look for following file in your system
"AccordingToYourOracle10gPath"\network\admin\tnsnames.ora file
In that you will find service name which is your SID created by oracle configuration tool.
Depending on Oracle version and JDK version you will need appropriate JDBC driver if you don't have.


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Inder Kumar Rathore
Ranch Hand

Joined: Apr 14, 2010
Posts: 41
This is my tnsnames.ora file..






Instead of using type 4 driver I used type 1 driver that is jdbc-odbc bridge, and the connection was established by crating a dsn ("mushi") and using same username and passowrd...

here I'll send my my source code...


Inder Kumar Rathore
Ranch Hand

Joined: Apr 14, 2010
Posts: 41
still not abel to connect...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to connect with 10g
 
Similar Threads
Problem connecting to database
cannot connect to oracle using datadirect JDBC driver
SQLException : The Network Adapter could not establish connection
getconnection() --> SQLException
The Network Adapter could not establish the connection in jdbc connection