Results 1 to 1 of 1
- 10-05-2012, 02:02 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 1
- Rep Power
- 0
java.sql.SQLException: Socket read timed out
e:\JavaPrgms\JDBC>javac SelectTest.javaJava Code:// SelectTest.java import java.sql.*; public class SelectTest { public static void main(String args[]) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger"); if (con == null) { System.out.println("Con not established.."); } else System.out.println("Conn established..."); } }
e:\JavaPrgms\JDBC>java SelectTest
Exception in thread "main" java.sql.SQLException: Socket read timed out
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(Physi calConnection.java:
531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnect ion.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnectio n(T4CDriverExtensio
n.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:503)
at java.sql.DriverManager.getConnection(DriverManager .java:582)
at java.sql.DriverManager.getConnection(DriverManager .java:185)
at SelectTest.main(SelectTest.java:11)
Caused by: oracle.net.ns.NetException: Socket read timed out
at oracle.net.ns.Packet.receive(Packet.java:320)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:2 86)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnec tion.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnecti on.java:301)
... 7 more
e:\JavaPrgms\JDBC>
So , Here i am using Windows7 64bit , Oracle 11g Releases 2 64bit version,
I tried same example with MySql database its working properly but here the socket is continuously reading and timeout exception is rised after 5 mins.. so how can i remove this exception ,?
i checked my port no in tnslistener.ora its "1521" and my sid is :"orcl" where the problem is ?
Similar Threads
-
java.sql.SQLException:
By nandhinianand in forum New To JavaReplies: 2Last Post: 09-28-2011, 07:15 AM -
java.net.SocketTimeoutException: Read timed
By ersachinjain in forum NetworkingReplies: 0Last Post: 11-17-2010, 04:50 PM -
Problem reading from socket using read(bytes[])
By sm123 in forum New To JavaReplies: 1Last Post: 04-21-2010, 06:49 PM -
connection timed out in my java code
By santhosh_el in forum AWT / SwingReplies: 4Last Post: 10-22-2009, 12:24 PM -
using Java to access a secure webpage, Exception occurred: Connection timed out
By toby in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 08-07-2007, 06:03 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks