Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't connect to oracle

 
Zoltan Susan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
I can connect to Oracle 8.1.6. server with this methods (from a simple class).
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc racle:thin:@qwert:asdfg:yxcvb", "scott", "tiger");
But if I try to do this from a servlet, I get the "no more data to read from socket" exception.
(from the getConnection method)
What is the problem ?
Thanks.
 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If u r using oracle thin driver then run this one and observer whethere is connected or not

import java.io.*;
public class pp {
public static void main(String jj[]) {
try {
java.net.Socket sock1 = new java.net.Socket("Systemname",1521);
System.out.println(sock1);

sock1.close();
} catch (Exception ex) {
ex.printStackTrace();}
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic