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

SQLException: The Network Adapter could not establish the connection?? what it means

 
Bhasker Reddy
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what does it mean, what error is it exactly
 
lokesh reddy
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can u please paste the code u r using to connect to the sql server.
for example:
Class.forName("jdbc dbc:......");
Connection con=DriverManager.getConnection(.....)
and also please mention, what type of sql server u r trying to connect.
 
Bhasker Reddy
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using oracle server. I am using this script inside JSP page It is a java code.
Did you work in JSP before.
<SCRIPT RUNAT="server">
public Connection doConnect(String connectString) {
Connection dbconn = null;

try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
//String url = "jdbc racle:thin:jaguar:1521:cbs";
System.out.println("I FOUND DRIVER FOR DATABASE");

} catch (java.lang.ClassNotFoundException ex) {
System.err.print("classNotFoundException: ");
System.err.println(ex.getMessage());

}


// Attempt to get a connection to the JDBC data source indicated in the connectString argument
try {
dbconn = DriverManager.getConnection(connectString, "cbs", "oldprod");
} catch (SQLException ex) {
System.err.println("SQLException: " + dbconn + ex.getMessage() );
System.out.println("something wrong with DriverManager");

}



return dbconn;
} // end doConnect()

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic