tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bodycombe, Andrew" <andrew.bodyco...@siemens.com>
Subject RE: Connection class unknown...
Date Mon, 06 Sep 2004 15:44:02 GMT
You could try importing java.sql.Connection (not javax.sql.Connection).

Maybe this would help.
 
Regards,
    Andy

-----Original Message-----
From: Sexy Prague
To: tomcat-user@jakarta.apache.org
Sent: 05/09/2004 18:12
Subject: Connection class unknown...

Hello everybody,

I've got a problem with creating Connection object in my jsp where I'd
like 
to use DB.
I use JNDI and this is the code of my jsp's scriptlet:

	Context initContext = new InitialContext();
	Context envContext  =
(Context)initContext.lookup("java:/comp/env");
	DataSource ds = (DataSource)envContext.lookup("jdbc/TestDB");
//until this part it works perfectly, but when I add the next line,
tomcat 
"screams", that
//can not resolve symbol Connection... so classic error with unknown
class
	Connection conn;
//after previous line it doesn't work

It is strange, because I have imported the whole javax.sql.* package

Have somebody already met this problem?

Thanks in advance, Peter

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. 
http://messenger.msn.cz/


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message