File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes SQLException: The Network Adapter could not establish the connection?? what it means Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "SQLException: The Network Adapter could not establish the connection?? what it means" Watch "SQLException: The Network Adapter could not establish the connection?? what it means" New topic
Author

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

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
what does it mean, what error is it exactly


Bhasker Reddy
lokesh reddy
Ranch Hand

Joined: Sep 15, 2000
Posts: 66
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

Joined: Jun 13, 2000
Posts: 176
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()

 
GeeCON Prague 2014
 
subject: SQLException: The Network Adapter could not establish the connection?? what it means