Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> JDBC Problem: Can't establish the connection

JDBC Problem: Can't establish the connection

From: Soeren Frey <junk_at_soerenfrey.de>
Date: Fri, 31 Oct 2003 02:26:24 +0100
Message-ID: <bnsdpj$15rf7o$1@ID-2052.news.uni-berlin.de>


Hi,

I have a problem connecting to a database using JDBC. I use the thin driver. I can connect to the database using SQLPlus. When I start the following program an SQLException is thrown:
"java.sql.SQLException: E/A-Exception: The Network Adaper could not establish the connection"
The simple propgram for testing is:



import java.sql.*;

public class Applik1
{

	public static void main(String[] args)
		throws ClassNotFoundException, SQLException
	{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		
		String user 	= "scott";
		String password = "tiger";
		String database = "MeineDB";
		Connection conn = 

DriverManager.getConnection("jdbc:oracle:thin:@notebook:1521:" + database, user, password);

        }
}


I use Win XP. "notebook" is the name of the computer (do I have to use something different ? It also doesn't work with "127.0.0.1"). The listener is started. Firewall is disabled. I searched the net for several hours now but couldn't find a solution. I would be very grateful if someone could give me a hint.

Greets

Soeren Received on Thu Oct 30 2003 - 19:26:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US