On Mon, May 07, 2001 at 10:46:59AM +0200, Cumps Jef wrote:
> Hi all, 
> 
> i'm trying to acces a SQL Server database through a stateless session bean called 
>DCS. When i execute the following code, i get a ClassCastException. And i can't 
>figure out why !!
> 
> the driver is in my path and classpath, the name is checked and ok, ...
> 
>  code: 
> 
> try
> {
> String myDriver = "com.inet.tds.TdsDriver";
> String url = "jdbc:inetdae7://onuris.groept.be?database=JFK_CarTracker";
> String loginname = "name";
> String password = "password";
> 
> Class.forName(myDriver);
> Connection con = DriverManager.getConnection(url,loginname,password);

Don't get a JDBC connection like that.  Set up a DataSource and refer to it
using the java:comp/env JNDI context.  See the many examples of this all
over the place.

Toby.

> 
> ...
> 
> Does anyone has an idea of what i am missing ??? Any help would be really 
>appreciated !
> 
> Jef Cumps

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to