tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chun, Byung (GEAE, Elano)" <>
Subject RE: Error with JDBC connecting from servlet
Date Tue, 18 Jul 2000 14:20:35 GMT
   assuming that the variable is 
initialized elsewhere (i.e. from a properties file, or a
runtime argument, etc. ), your connection string in the 
code should look like:

	String strDBHost =;
	String strConnectURL = "jdbc:oracle:thin@" + strDBHost +

	_iobjConnection = DriverManager.getConnection(
					strConnectURL, this.get_isDBUserName(),
					this.get_isDBPassword() );

Since your using the default sid of ORCL, generally it is :

	jdbc:oracle:thin@<network machine name>:1521:ORCL



-----Original Message-----
From: Dudley Irish []
Sent: Monday, July 17, 2000 5:32 PM
Subject: Re: Error with JDBC connecting from servlet

It means using something like the following to connect to the database
rather than getting the connection information from configuration

   _iobjConnection = DriverManager.getConnection( new String(
"jdbc:oracle:thin:@(DESCRIPTION= (ADDRESS= (PROTOCOL = TCP)(HOST = = 1521))(CONNECT_DATA = (SID = ORCL))  )" ),
this.get_isDBUserName(), this.get_isDBPassword());

What makes this frustrating for me is that get_isDBUserName(),
get_isDBPassword() are fetching information from the configuration
file and to make matters worse the configuration file has a line to
specify the database but the code doesn't use it.

Dudley Irish

View raw message