File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Need JDBC driver for JDK 6 Oracle 10g (10.2.0.4) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need JDBC driver for JDK 6 Oracle 10g (10.2.0.4)" Watch "Need JDBC driver for JDK 6 Oracle 10g (10.2.0.4)" New topic
Author

Need JDBC driver for JDK 6 Oracle 10g (10.2.0.4)

Ajit Sawant
Ranch Hand

Joined: Nov 26, 2008
Posts: 33
Hello,

I have JDK 6 and database Oracle 10g (10.2.0.4) for which I need a jdbc driver. I checked oracle website. The JDBC driver for JDK 1.6 is for 11g only
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_111060.html
And 10g support JDK 1.5 JDBC driver.
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
Is there any workaround for me to able to use JDK 6 and 10g for JDBC?
I have JDK 1.5 also on my machine. What should do to make my current JDK to be 1.5. This will at least let me use JDBC.

Thanks in advance.
Ajit
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

You still can use JDK 6 with that Oracle driver. There should be no issue.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Ajit Sawant
Ranch Hand

Joined: Nov 26, 2008
Posts: 33
I tried following 2 combition one each with ojdbc5.jar and ojdbc6.jar, I got the error for both.
Jdk 6 Jdbc: ojdbc5.jar Database : Oracle 10.2.0.4
Error
Exception in thread "main" java.sql.SQLException: Io exception: Unknown host specified
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:441)
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(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at testjdbc.main(testjdbc.java:11)


Jdk 6 Jdbc: ojdbc6.jar Database : Oracle 10.2.0.4
Error:
Exception in thread "main" java.sql.SQLException: Unknown host specified
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.jva:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java33)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java508)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensin.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at testjdbc.main(testjdbc.java:11)
Caused by: oracle.net.ns.NetException: Unknown host specified
at oracle.net.resolver.HostnameNamingAdapter.resolve(HostnameNamingAdaper.java:187)
at oracle.net.resolver.NameResolver.resolveName(NameResolver.java:130)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:403)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:630)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:206)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)
... 7 more

Any suggestions?
Thanks,
Ajit
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

The problem seems to be in your connection URL.
Ajit Sawant
Ranch Hand

Joined: Nov 26, 2008
Posts: 33
I'm able to the server wwdcssofd01. ping comes back with
Reply from 10.25.248.143: bytes=32 time=197ms TTL=245
Reply from 10.25.248.143: bytes=32 time=223ms TTL=245
Her'e the code.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959


That doesn't look correct.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need JDBC driver for JDK 6 Oracle 10g (10.2.0.4)
 
Similar Threads
Exception while connecting to an Oracle database
Right Driver, Page, and Time To Download?
Oracle 9i and J2SE 1.6 compatibility
AbstractMethodError
Exception in thread "main" java.sql.SQLException: No suitable driver