aspose file tools*
The moose likes JDBC and the fly likes connect oracle from java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connect oracle from java application" Watch "connect oracle from java application" New topic
Author

connect oracle from java application

venkat penmatsa
Greenhorn

Joined: Jul 23, 2011
Posts: 17
Hi All,

I am trying to connect oracle from java application,but i am getting the following error

Exception in thread "main" java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Connect.main(Connect.java:12)



my code is


i am using oracle 10g and also tell me what are the jar files required for connecting oracle DB now i am using ojdbc14 jar
please help me ASAP.
nazzy khan
Ranch Hand

Joined: May 06, 2010
Posts: 39

Can you please check database connection using Toad or Aqua Studio. Are you able to connect successfully using them?
venkat penmatsa
Greenhorn

Joined: Jul 23, 2011
Posts: 17
nazzy khan wrote:Can you please check database connection using Toad or Aqua Studio. Are you able to connect successfully using them?



Hi,

Thanks for your suggestion but i dont know about Aqua studio please tell me how to check database connection with Aqua studio.
nazzy khan
Ranch Hand

Joined: May 06, 2010
Posts: 39

Well if you don't have Aqua Studio, you can use any other tool like Toad or even SQL Plus that comes with Oracle itself.

Idea here is to check whether are you able to connect to oracle database. If connection from Toad or SQL Plus is also not working then the problem lies at somewhere else.

If connection is fine with the same jdbc url details which you have used in your code, then we need to look code further.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connect oracle from java application